1#![doc = "MAVLink development dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
21#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22#[cfg_attr(feature = "serde", serde(tag = "type"))]
23#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24#[repr(u32)]
25#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
26pub enum ActuatorConfiguration {
27 #[doc = "Do nothing."]
28 ACTUATOR_CONFIGURATION_NONE = 0,
29 #[doc = "Command the actuator to beep now."]
30 ACTUATOR_CONFIGURATION_BEEP = 1,
31 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
32 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
33 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
34 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
35 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
36 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
37 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
38 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
39}
40impl ActuatorConfiguration {
41 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
42}
43impl Default for ActuatorConfiguration {
44 fn default() -> Self {
45 Self::DEFAULT
46 }
47}
48#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
49#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
50#[cfg_attr(feature = "serde", serde(tag = "type"))]
51#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
52#[repr(u32)]
53#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
54pub enum ActuatorOutputFunction {
55 #[doc = "No function (disabled)."]
56 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
57 #[doc = "Motor 1"]
58 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
59 #[doc = "Motor 2"]
60 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
61 #[doc = "Motor 3"]
62 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
63 #[doc = "Motor 4"]
64 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
65 #[doc = "Motor 5"]
66 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
67 #[doc = "Motor 6"]
68 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
69 #[doc = "Motor 7"]
70 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
71 #[doc = "Motor 8"]
72 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
73 #[doc = "Motor 9"]
74 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
75 #[doc = "Motor 10"]
76 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
77 #[doc = "Motor 11"]
78 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
79 #[doc = "Motor 12"]
80 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
81 #[doc = "Motor 13"]
82 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
83 #[doc = "Motor 14"]
84 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
85 #[doc = "Motor 15"]
86 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
87 #[doc = "Motor 16"]
88 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
89 #[doc = "Servo 1"]
90 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
91 #[doc = "Servo 2"]
92 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
93 #[doc = "Servo 3"]
94 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
95 #[doc = "Servo 4"]
96 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
97 #[doc = "Servo 5"]
98 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
99 #[doc = "Servo 6"]
100 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
101 #[doc = "Servo 7"]
102 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
103 #[doc = "Servo 8"]
104 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
105 #[doc = "Servo 9"]
106 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
107 #[doc = "Servo 10"]
108 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
109 #[doc = "Servo 11"]
110 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
111 #[doc = "Servo 12"]
112 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
113 #[doc = "Servo 13"]
114 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
115 #[doc = "Servo 14"]
116 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
117 #[doc = "Servo 15"]
118 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
119 #[doc = "Servo 16"]
120 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
121}
122impl ActuatorOutputFunction {
123 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
124}
125impl Default for ActuatorOutputFunction {
126 fn default() -> Self {
127 Self::DEFAULT
128 }
129}
130#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
132#[cfg_attr(feature = "serde", serde(tag = "type"))]
133#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
134#[repr(u32)]
135#[doc = "Enumeration of the ADSB altimeter types"]
136pub enum AdsbAltitudeType {
137 #[doc = "Altitude reported from a Baro source using QNH reference"]
138 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
139 #[doc = "Altitude reported from a GNSS source"]
140 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
141}
142impl AdsbAltitudeType {
143 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
144}
145impl Default for AdsbAltitudeType {
146 fn default() -> Self {
147 Self::DEFAULT
148 }
149}
150#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
151#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
152#[cfg_attr(feature = "serde", serde(tag = "type"))]
153#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
154#[repr(u32)]
155#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
156pub enum AdsbEmitterType {
157 ADSB_EMITTER_TYPE_NO_INFO = 0,
158 ADSB_EMITTER_TYPE_LIGHT = 1,
159 ADSB_EMITTER_TYPE_SMALL = 2,
160 ADSB_EMITTER_TYPE_LARGE = 3,
161 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
162 ADSB_EMITTER_TYPE_HEAVY = 5,
163 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
164 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
165 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
166 ADSB_EMITTER_TYPE_GLIDER = 9,
167 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
168 ADSB_EMITTER_TYPE_PARACHUTE = 11,
169 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
170 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
171 ADSB_EMITTER_TYPE_UAV = 14,
172 ADSB_EMITTER_TYPE_SPACE = 15,
173 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
174 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
175 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
176 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
177}
178impl AdsbEmitterType {
179 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
180}
181impl Default for AdsbEmitterType {
182 fn default() -> Self {
183 Self::DEFAULT
184 }
185}
186bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
187impl AdsbFlags {
188 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
189}
190impl Default for AdsbFlags {
191 fn default() -> Self {
192 Self::DEFAULT
193 }
194}
195bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Airspeed sensor flags"] pub struct AirspeedSensorFlags : u8 { # [doc = "Airspeed sensor is unhealthy"] const AIRSPEED_SENSOR_UNHEALTHY = 1 ; # [doc = "True if the data from this sensor is being actively used by the flight controller for guidance, navigation or control."] const AIRSPEED_SENSOR_USING = 2 ; } }
196impl AirspeedSensorFlags {
197 pub const DEFAULT: Self = Self::AIRSPEED_SENSOR_UNHEALTHY;
198}
199impl Default for AirspeedSensorFlags {
200 fn default() -> Self {
201 Self::DEFAULT
202 }
203}
204bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
205impl AisFlags {
206 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
207}
208impl Default for AisFlags {
209 fn default() -> Self {
210 Self::DEFAULT
211 }
212}
213#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
215#[cfg_attr(feature = "serde", serde(tag = "type"))]
216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
217#[repr(u32)]
218#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
219pub enum AisNavStatus {
220 #[doc = "Under way using engine."]
221 UNDER_WAY = 0,
222 AIS_NAV_ANCHORED = 1,
223 AIS_NAV_UN_COMMANDED = 2,
224 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
225 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
226 AIS_NAV_MOORED = 5,
227 AIS_NAV_AGROUND = 6,
228 AIS_NAV_FISHING = 7,
229 AIS_NAV_SAILING = 8,
230 AIS_NAV_RESERVED_HSC = 9,
231 AIS_NAV_RESERVED_WIG = 10,
232 AIS_NAV_RESERVED_1 = 11,
233 AIS_NAV_RESERVED_2 = 12,
234 AIS_NAV_RESERVED_3 = 13,
235 #[doc = "Search And Rescue Transponder."]
236 AIS_NAV_AIS_SART = 14,
237 #[doc = "Not available (default)."]
238 AIS_NAV_UNKNOWN = 15,
239}
240impl AisNavStatus {
241 pub const DEFAULT: Self = Self::UNDER_WAY;
242}
243impl Default for AisNavStatus {
244 fn default() -> Self {
245 Self::DEFAULT
246 }
247}
248#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
250#[cfg_attr(feature = "serde", serde(tag = "type"))]
251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
252#[repr(u32)]
253#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
254pub enum AisType {
255 #[doc = "Not available (default)."]
256 AIS_TYPE_UNKNOWN = 0,
257 AIS_TYPE_RESERVED_1 = 1,
258 AIS_TYPE_RESERVED_2 = 2,
259 AIS_TYPE_RESERVED_3 = 3,
260 AIS_TYPE_RESERVED_4 = 4,
261 AIS_TYPE_RESERVED_5 = 5,
262 AIS_TYPE_RESERVED_6 = 6,
263 AIS_TYPE_RESERVED_7 = 7,
264 AIS_TYPE_RESERVED_8 = 8,
265 AIS_TYPE_RESERVED_9 = 9,
266 AIS_TYPE_RESERVED_10 = 10,
267 AIS_TYPE_RESERVED_11 = 11,
268 AIS_TYPE_RESERVED_12 = 12,
269 AIS_TYPE_RESERVED_13 = 13,
270 AIS_TYPE_RESERVED_14 = 14,
271 AIS_TYPE_RESERVED_15 = 15,
272 AIS_TYPE_RESERVED_16 = 16,
273 AIS_TYPE_RESERVED_17 = 17,
274 AIS_TYPE_RESERVED_18 = 18,
275 AIS_TYPE_RESERVED_19 = 19,
276 #[doc = "Wing In Ground effect."]
277 AIS_TYPE_WIG = 20,
278 AIS_TYPE_WIG_HAZARDOUS_A = 21,
279 AIS_TYPE_WIG_HAZARDOUS_B = 22,
280 AIS_TYPE_WIG_HAZARDOUS_C = 23,
281 AIS_TYPE_WIG_HAZARDOUS_D = 24,
282 AIS_TYPE_WIG_RESERVED_1 = 25,
283 AIS_TYPE_WIG_RESERVED_2 = 26,
284 AIS_TYPE_WIG_RESERVED_3 = 27,
285 AIS_TYPE_WIG_RESERVED_4 = 28,
286 AIS_TYPE_WIG_RESERVED_5 = 29,
287 AIS_TYPE_FISHING = 30,
288 AIS_TYPE_TOWING = 31,
289 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
290 AIS_TYPE_TOWING_LARGE = 32,
291 #[doc = "Dredging or other underwater ops."]
292 AIS_TYPE_DREDGING = 33,
293 AIS_TYPE_DIVING = 34,
294 AIS_TYPE_MILITARY = 35,
295 AIS_TYPE_SAILING = 36,
296 AIS_TYPE_PLEASURE = 37,
297 AIS_TYPE_RESERVED_20 = 38,
298 AIS_TYPE_RESERVED_21 = 39,
299 #[doc = "High Speed Craft."]
300 AIS_TYPE_HSC = 40,
301 AIS_TYPE_HSC_HAZARDOUS_A = 41,
302 AIS_TYPE_HSC_HAZARDOUS_B = 42,
303 AIS_TYPE_HSC_HAZARDOUS_C = 43,
304 AIS_TYPE_HSC_HAZARDOUS_D = 44,
305 AIS_TYPE_HSC_RESERVED_1 = 45,
306 AIS_TYPE_HSC_RESERVED_2 = 46,
307 AIS_TYPE_HSC_RESERVED_3 = 47,
308 AIS_TYPE_HSC_RESERVED_4 = 48,
309 AIS_TYPE_HSC_UNKNOWN = 49,
310 AIS_TYPE_PILOT = 50,
311 #[doc = "Search And Rescue vessel."]
312 AIS_TYPE_SAR = 51,
313 AIS_TYPE_TUG = 52,
314 AIS_TYPE_PORT_TENDER = 53,
315 #[doc = "Anti-pollution equipment."]
316 AIS_TYPE_ANTI_POLLUTION = 54,
317 AIS_TYPE_LAW_ENFORCEMENT = 55,
318 AIS_TYPE_SPARE_LOCAL_1 = 56,
319 AIS_TYPE_SPARE_LOCAL_2 = 57,
320 AIS_TYPE_MEDICAL_TRANSPORT = 58,
321 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
322 AIS_TYPE_NONECOMBATANT = 59,
323 AIS_TYPE_PASSENGER = 60,
324 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
325 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
326 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
327 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
328 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
329 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
330 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
331 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
332 AIS_TYPE_PASSENGER_UNKNOWN = 69,
333 AIS_TYPE_CARGO = 70,
334 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
335 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
336 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
337 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
338 AIS_TYPE_CARGO_RESERVED_1 = 75,
339 AIS_TYPE_CARGO_RESERVED_2 = 76,
340 AIS_TYPE_CARGO_RESERVED_3 = 77,
341 AIS_TYPE_CARGO_RESERVED_4 = 78,
342 AIS_TYPE_CARGO_UNKNOWN = 79,
343 AIS_TYPE_TANKER = 80,
344 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
345 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
346 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
347 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
348 AIS_TYPE_TANKER_RESERVED_1 = 85,
349 AIS_TYPE_TANKER_RESERVED_2 = 86,
350 AIS_TYPE_TANKER_RESERVED_3 = 87,
351 AIS_TYPE_TANKER_RESERVED_4 = 88,
352 AIS_TYPE_TANKER_UNKNOWN = 89,
353 AIS_TYPE_OTHER = 90,
354 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
355 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
356 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
357 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
358 AIS_TYPE_OTHER_RESERVED_1 = 95,
359 AIS_TYPE_OTHER_RESERVED_2 = 96,
360 AIS_TYPE_OTHER_RESERVED_3 = 97,
361 AIS_TYPE_OTHER_RESERVED_4 = 98,
362 AIS_TYPE_OTHER_UNKNOWN = 99,
363}
364impl AisType {
365 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
366}
367impl Default for AisType {
368 fn default() -> Self {
369 Self::DEFAULT
370 }
371}
372bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
373impl AttitudeTargetTypemask {
374 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
375}
376impl Default for AttitudeTargetTypemask {
377 fn default() -> Self {
378 Self::DEFAULT
379 }
380}
381#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
383#[cfg_attr(feature = "serde", serde(tag = "type"))]
384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
385#[repr(u32)]
386#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
387pub enum AutotuneAxis {
388 #[doc = "Autotune roll axis."]
389 AUTOTUNE_AXIS_ROLL = 1,
390 #[doc = "Autotune pitch axis."]
391 AUTOTUNE_AXIS_PITCH = 2,
392 #[doc = "Autotune yaw axis."]
393 AUTOTUNE_AXIS_YAW = 4,
394}
395impl AutotuneAxis {
396 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
397}
398impl Default for AutotuneAxis {
399 fn default() -> Self {
400 Self::DEFAULT
401 }
402}
403bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
404impl CameraCapFlags {
405 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
406}
407impl Default for CameraCapFlags {
408 fn default() -> Self {
409 Self::DEFAULT
410 }
411}
412#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
413#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
414#[cfg_attr(feature = "serde", serde(tag = "type"))]
415#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
416#[repr(u32)]
417#[doc = "Camera Modes."]
418pub enum CameraMode {
419 #[doc = "Camera is in image/photo capture mode."]
420 CAMERA_MODE_IMAGE = 0,
421 #[doc = "Camera is in video capture mode."]
422 CAMERA_MODE_VIDEO = 1,
423 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
424 CAMERA_MODE_IMAGE_SURVEY = 2,
425}
426impl CameraMode {
427 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
428}
429impl Default for CameraMode {
430 fn default() -> Self {
431 Self::DEFAULT
432 }
433}
434#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
435#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
436#[cfg_attr(feature = "serde", serde(tag = "type"))]
437#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
438#[repr(u32)]
439#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
440pub enum CameraSource {
441 #[doc = "Default camera source."]
442 CAMERA_SOURCE_DEFAULT = 0,
443 #[doc = "RGB camera source."]
444 CAMERA_SOURCE_RGB = 1,
445 #[doc = "IR camera source."]
446 CAMERA_SOURCE_IR = 2,
447 #[doc = "NDVI camera source."]
448 CAMERA_SOURCE_NDVI = 3,
449}
450impl CameraSource {
451 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
452}
453impl Default for CameraSource {
454 fn default() -> Self {
455 Self::DEFAULT
456 }
457}
458#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
459#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
460#[cfg_attr(feature = "serde", serde(tag = "type"))]
461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
462#[repr(u32)]
463#[doc = "Camera tracking modes"]
464pub enum CameraTrackingMode {
465 #[doc = "Not tracking"]
466 CAMERA_TRACKING_MODE_NONE = 0,
467 #[doc = "Target is a point"]
468 CAMERA_TRACKING_MODE_POINT = 1,
469 #[doc = "Target is a rectangle"]
470 CAMERA_TRACKING_MODE_RECTANGLE = 2,
471}
472impl CameraTrackingMode {
473 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
474}
475impl Default for CameraTrackingMode {
476 fn default() -> Self {
477 Self::DEFAULT
478 }
479}
480#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
482#[cfg_attr(feature = "serde", serde(tag = "type"))]
483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
484#[repr(u32)]
485#[doc = "Camera tracking status flags"]
486pub enum CameraTrackingStatusFlags {
487 #[doc = "Camera is not tracking"]
488 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
489 #[doc = "Camera is tracking"]
490 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
491 #[doc = "Camera tracking in error state"]
492 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
493}
494impl CameraTrackingStatusFlags {
495 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
496}
497impl Default for CameraTrackingStatusFlags {
498 fn default() -> Self {
499 Self::DEFAULT
500 }
501}
502bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
503impl CameraTrackingTargetData {
504 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
505}
506impl Default for CameraTrackingTargetData {
507 fn default() -> Self {
508 Self::DEFAULT
509 }
510}
511#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
513#[cfg_attr(feature = "serde", serde(tag = "type"))]
514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
515#[repr(u32)]
516#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
517pub enum CameraZoomType {
518 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
519 ZOOM_TYPE_STEP = 0,
520 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
521 ZOOM_TYPE_CONTINUOUS = 1,
522 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
523 ZOOM_TYPE_RANGE = 2,
524 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
525 ZOOM_TYPE_FOCAL_LENGTH = 3,
526 #[doc = "Zoom value as horizontal field of view in degrees."]
527 ZOOM_TYPE_HORIZONTAL_FOV = 4,
528}
529impl CameraZoomType {
530 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
531}
532impl Default for CameraZoomType {
533 fn default() -> Self {
534 Self::DEFAULT
535 }
536}
537#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
539#[cfg_attr(feature = "serde", serde(tag = "type"))]
540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
541#[repr(u32)]
542pub enum CanFilterOp {
543 CAN_FILTER_REPLACE = 0,
544 CAN_FILTER_ADD = 1,
545 CAN_FILTER_REMOVE = 2,
546}
547impl CanFilterOp {
548 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
549}
550impl Default for CanFilterOp {
551 fn default() -> Self {
552 Self::DEFAULT
553 }
554}
555#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
556#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
557#[cfg_attr(feature = "serde", serde(tag = "type"))]
558#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
559#[repr(u32)]
560#[doc = "Possible responses from a CELLULAR_CONFIG message."]
561pub enum CellularConfigResponse {
562 #[doc = "Changes accepted."]
563 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
564 #[doc = "Invalid APN."]
565 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
566 #[doc = "Invalid PIN."]
567 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
568 #[doc = "Changes rejected."]
569 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
570 #[doc = "PUK is required to unblock SIM card."]
571 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
572}
573impl CellularConfigResponse {
574 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
575}
576impl Default for CellularConfigResponse {
577 fn default() -> Self {
578 Self::DEFAULT
579 }
580}
581#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
582#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
583#[cfg_attr(feature = "serde", serde(tag = "type"))]
584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
585#[repr(u32)]
586#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
587pub enum CellularNetworkFailedReason {
588 #[doc = "No error"]
589 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
590 #[doc = "Error state is unknown"]
591 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
592 #[doc = "SIM is required for the modem but missing"]
593 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
594 #[doc = "SIM is available, but not usable for connection"]
595 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
596}
597impl CellularNetworkFailedReason {
598 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
599}
600impl Default for CellularNetworkFailedReason {
601 fn default() -> Self {
602 Self::DEFAULT
603 }
604}
605#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
607#[cfg_attr(feature = "serde", serde(tag = "type"))]
608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
609#[repr(u32)]
610#[doc = "Cellular network radio type"]
611pub enum CellularNetworkRadioType {
612 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
613 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
614 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
615 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
616 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
617}
618impl CellularNetworkRadioType {
619 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
620}
621impl Default for CellularNetworkRadioType {
622 fn default() -> Self {
623 Self::DEFAULT
624 }
625}
626#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
627#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
628#[cfg_attr(feature = "serde", serde(tag = "type"))]
629#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
630#[repr(u32)]
631#[doc = "These flags encode the cellular network status"]
632pub enum CellularStatusFlag {
633 #[doc = "State unknown or not reportable."]
634 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
635 #[doc = "Modem is unusable"]
636 CELLULAR_STATUS_FLAG_FAILED = 1,
637 #[doc = "Modem is being initialized"]
638 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
639 #[doc = "Modem is locked"]
640 CELLULAR_STATUS_FLAG_LOCKED = 3,
641 #[doc = "Modem is not enabled and is powered down"]
642 CELLULAR_STATUS_FLAG_DISABLED = 4,
643 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
644 CELLULAR_STATUS_FLAG_DISABLING = 5,
645 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
646 CELLULAR_STATUS_FLAG_ENABLING = 6,
647 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
648 CELLULAR_STATUS_FLAG_ENABLED = 7,
649 #[doc = "Modem is searching for a network provider to register"]
650 CELLULAR_STATUS_FLAG_SEARCHING = 8,
651 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
652 CELLULAR_STATUS_FLAG_REGISTERED = 9,
653 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
654 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
655 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
656 CELLULAR_STATUS_FLAG_CONNECTING = 11,
657 #[doc = "One or more packet data bearers is active and connected"]
658 CELLULAR_STATUS_FLAG_CONNECTED = 12,
659}
660impl CellularStatusFlag {
661 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
662}
663impl Default for CellularStatusFlag {
664 fn default() -> Self {
665 Self::DEFAULT
666 }
667}
668#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
670#[cfg_attr(feature = "serde", serde(tag = "type"))]
671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
672#[repr(u32)]
673#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
674pub enum CompMetadataType {
675 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
676 COMP_METADATA_TYPE_GENERAL = 0,
677 #[doc = "Parameter meta data."]
678 COMP_METADATA_TYPE_PARAMETER = 1,
679 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
680 COMP_METADATA_TYPE_COMMANDS = 2,
681 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
682 COMP_METADATA_TYPE_PERIPHERALS = 3,
683 #[doc = "Meta data for the events interface."]
684 COMP_METADATA_TYPE_EVENTS = 4,
685 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
686 COMP_METADATA_TYPE_ACTUATORS = 5,
687}
688impl CompMetadataType {
689 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
690}
691impl Default for CompMetadataType {
692 fn default() -> Self {
693 Self::DEFAULT
694 }
695}
696#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
697#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
698#[cfg_attr(feature = "serde", serde(tag = "type"))]
699#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
700#[repr(u32)]
701#[doc = "Indicates the ESC connection type."]
702pub enum EscConnectionType {
703 #[doc = "Traditional PPM ESC."]
704 ESC_CONNECTION_TYPE_PPM = 0,
705 #[doc = "Serial Bus connected ESC."]
706 ESC_CONNECTION_TYPE_SERIAL = 1,
707 #[doc = "One Shot PPM ESC."]
708 ESC_CONNECTION_TYPE_ONESHOT = 2,
709 #[doc = "I2C ESC."]
710 ESC_CONNECTION_TYPE_I2C = 3,
711 #[doc = "CAN-Bus ESC."]
712 ESC_CONNECTION_TYPE_CAN = 4,
713 #[doc = "DShot ESC."]
714 ESC_CONNECTION_TYPE_DSHOT = 5,
715}
716impl EscConnectionType {
717 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
718}
719impl Default for EscConnectionType {
720 fn default() -> Self {
721 Self::DEFAULT
722 }
723}
724bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
725impl EscFailureFlags {
726 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
727}
728impl Default for EscFailureFlags {
729 fn default() -> Self {
730 Self::DEFAULT
731 }
732}
733bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
734impl EstimatorStatusFlags {
735 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
736}
737impl Default for EstimatorStatusFlags {
738 fn default() -> Self {
739 Self::DEFAULT
740 }
741}
742#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
743#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
744#[cfg_attr(feature = "serde", serde(tag = "type"))]
745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
746#[repr(u32)]
747#[doc = "List of possible failure type to inject."]
748pub enum FailureType {
749 #[doc = "No failure injected, used to reset a previous failure."]
750 FAILURE_TYPE_OK = 0,
751 #[doc = "Sets unit off, so completely non-responsive."]
752 FAILURE_TYPE_OFF = 1,
753 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
754 FAILURE_TYPE_STUCK = 2,
755 #[doc = "Unit is reporting complete garbage."]
756 FAILURE_TYPE_GARBAGE = 3,
757 #[doc = "Unit is consistently wrong."]
758 FAILURE_TYPE_WRONG = 4,
759 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
760 FAILURE_TYPE_SLOW = 5,
761 #[doc = "Data of unit is delayed in time."]
762 FAILURE_TYPE_DELAYED = 6,
763 #[doc = "Unit is sometimes working, sometimes not."]
764 FAILURE_TYPE_INTERMITTENT = 7,
765}
766impl FailureType {
767 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
768}
769impl Default for FailureType {
770 fn default() -> Self {
771 Self::DEFAULT
772 }
773}
774#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
775#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
776#[cfg_attr(feature = "serde", serde(tag = "type"))]
777#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
778#[repr(u32)]
779#[doc = "List of possible units where failures can be injected."]
780pub enum FailureUnit {
781 FAILURE_UNIT_SENSOR_GYRO = 0,
782 FAILURE_UNIT_SENSOR_ACCEL = 1,
783 FAILURE_UNIT_SENSOR_MAG = 2,
784 FAILURE_UNIT_SENSOR_BARO = 3,
785 FAILURE_UNIT_SENSOR_GPS = 4,
786 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
787 FAILURE_UNIT_SENSOR_VIO = 6,
788 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
789 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
790 FAILURE_UNIT_SYSTEM_BATTERY = 100,
791 FAILURE_UNIT_SYSTEM_MOTOR = 101,
792 FAILURE_UNIT_SYSTEM_SERVO = 102,
793 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
794 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
795 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
796}
797impl FailureUnit {
798 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
799}
800impl Default for FailureUnit {
801 fn default() -> Self {
802 Self::DEFAULT
803 }
804}
805#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
806#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
807#[cfg_attr(feature = "serde", serde(tag = "type"))]
808#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
809#[repr(u32)]
810pub enum FenceBreach {
811 #[doc = "No last fence breach"]
812 FENCE_BREACH_NONE = 0,
813 #[doc = "Breached minimum altitude"]
814 FENCE_BREACH_MINALT = 1,
815 #[doc = "Breached maximum altitude"]
816 FENCE_BREACH_MAXALT = 2,
817 #[doc = "Breached fence boundary"]
818 FENCE_BREACH_BOUNDARY = 3,
819}
820impl FenceBreach {
821 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
822}
823impl Default for FenceBreach {
824 fn default() -> Self {
825 Self::DEFAULT
826 }
827}
828#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
830#[cfg_attr(feature = "serde", serde(tag = "type"))]
831#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
832#[repr(u32)]
833#[doc = "Actions being taken to mitigate/prevent fence breach"]
834pub enum FenceMitigate {
835 #[doc = "Unknown"]
836 FENCE_MITIGATE_UNKNOWN = 0,
837 #[doc = "No actions being taken"]
838 FENCE_MITIGATE_NONE = 1,
839 #[doc = "Velocity limiting active to prevent breach"]
840 FENCE_MITIGATE_VEL_LIMIT = 2,
841}
842impl FenceMitigate {
843 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
844}
845impl Default for FenceMitigate {
846 fn default() -> Self {
847 Self::DEFAULT
848 }
849}
850#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
851#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
852#[cfg_attr(feature = "serde", serde(tag = "type"))]
853#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
854#[repr(u32)]
855#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
856pub enum FenceType {
857 #[doc = "Maximum altitude fence"]
858 FENCE_TYPE_ALT_MAX = 1,
859 #[doc = "Circle fence"]
860 FENCE_TYPE_CIRCLE = 2,
861 #[doc = "Polygon fence"]
862 FENCE_TYPE_POLYGON = 4,
863 #[doc = "Minimum altitude fence"]
864 FENCE_TYPE_ALT_MIN = 8,
865}
866impl FenceType {
867 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
868}
869impl Default for FenceType {
870 fn default() -> Self {
871 Self::DEFAULT
872 }
873}
874#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
875#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
876#[cfg_attr(feature = "serde", serde(tag = "type"))]
877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
878#[repr(u32)]
879#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
880pub enum FirmwareVersionType {
881 #[doc = "development release"]
882 FIRMWARE_VERSION_TYPE_DEV = 0,
883 #[doc = "alpha release"]
884 FIRMWARE_VERSION_TYPE_ALPHA = 64,
885 #[doc = "beta release"]
886 FIRMWARE_VERSION_TYPE_BETA = 128,
887 #[doc = "release candidate"]
888 FIRMWARE_VERSION_TYPE_RC = 192,
889 #[doc = "official stable release"]
890 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
891}
892impl FirmwareVersionType {
893 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
894}
895impl Default for FirmwareVersionType {
896 fn default() -> Self {
897 Self::DEFAULT
898 }
899}
900bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "CONTROL_STATUS flags."] pub struct GcsControlStatusFlags : u8 { # [doc = "If set, this CONTROL_STATUS publishes the controlling GCS for the whole system. If unset, the CONTROL_STATUS indicates the controlling GCS for just the component emitting the message. Note that to request control of the system a GCS should send MAV_CMD_REQUEST_OPERATOR_CONTROL to the component emitting CONTROL_STATUS with this flag set."] const GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER = 1 ; # [doc = "Takeover allowed (requests for control will be granted). If not set requests for control will be rejected, but the controlling GCS will be notified (and may release control or allow takeover)."] const GCS_CONTROL_STATUS_FLAGS_TAKEOVER_ALLOWED = 2 ; } }
901impl GcsControlStatusFlags {
902 pub const DEFAULT: Self = Self::GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER;
903}
904impl Default for GcsControlStatusFlags {
905 fn default() -> Self {
906 Self::DEFAULT
907 }
908}
909bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
910impl GimbalDeviceCapFlags {
911 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
912}
913impl Default for GimbalDeviceCapFlags {
914 fn default() -> Self {
915 Self::DEFAULT
916 }
917}
918bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
919impl GimbalDeviceErrorFlags {
920 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
921}
922impl Default for GimbalDeviceErrorFlags {
923 fn default() -> Self {
924 Self::DEFAULT
925 }
926}
927bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
928impl GimbalDeviceFlags {
929 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
930}
931impl Default for GimbalDeviceFlags {
932 fn default() -> Self {
933 Self::DEFAULT
934 }
935}
936bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
937impl GimbalManagerCapFlags {
938 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
939}
940impl Default for GimbalManagerCapFlags {
941 fn default() -> Self {
942 Self::DEFAULT
943 }
944}
945bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
946impl GimbalManagerFlags {
947 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
948}
949impl Default for GimbalManagerFlags {
950 fn default() -> Self {
951 Self::DEFAULT
952 }
953}
954#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
955#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
956#[cfg_attr(feature = "serde", serde(tag = "type"))]
957#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
958#[repr(u32)]
959#[doc = "Signal authentication state in a GPS receiver."]
960pub enum GpsAuthenticationState {
961 #[doc = "The GPS receiver does not provide GPS signal authentication info."]
962 GPS_AUTHENTICATION_STATE_UNKNOWN = 0,
963 #[doc = "The GPS receiver is initializing signal authentication."]
964 GPS_AUTHENTICATION_STATE_INITIALIZING = 1,
965 #[doc = "The GPS receiver encountered an error while initializing signal authentication."]
966 GPS_AUTHENTICATION_STATE_ERROR = 2,
967 #[doc = "The GPS receiver has correctly authenticated all signals."]
968 GPS_AUTHENTICATION_STATE_OK = 3,
969 #[doc = "GPS signal authentication is disabled on the receiver."]
970 GPS_AUTHENTICATION_STATE_DISABLED = 4,
971}
972impl GpsAuthenticationState {
973 pub const DEFAULT: Self = Self::GPS_AUTHENTICATION_STATE_UNKNOWN;
974}
975impl Default for GpsAuthenticationState {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
982#[cfg_attr(feature = "serde", serde(tag = "type"))]
983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
984#[repr(u32)]
985#[doc = "Type of GPS fix"]
986pub enum GpsFixType {
987 #[doc = "No GPS connected"]
988 GPS_FIX_TYPE_NO_GPS = 0,
989 #[doc = "No position information, GPS is connected"]
990 GPS_FIX_TYPE_NO_FIX = 1,
991 #[doc = "2D position"]
992 GPS_FIX_TYPE_2D_FIX = 2,
993 #[doc = "3D position"]
994 GPS_FIX_TYPE_3D_FIX = 3,
995 #[doc = "DGPS/SBAS aided 3D position"]
996 GPS_FIX_TYPE_DGPS = 4,
997 #[doc = "RTK float, 3D position"]
998 GPS_FIX_TYPE_RTK_FLOAT = 5,
999 #[doc = "RTK Fixed, 3D position"]
1000 GPS_FIX_TYPE_RTK_FIXED = 6,
1001 #[doc = "Static fixed, typically used for base stations"]
1002 GPS_FIX_TYPE_STATIC = 7,
1003 #[doc = "PPP, 3D position."]
1004 GPS_FIX_TYPE_PPP = 8,
1005}
1006impl GpsFixType {
1007 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1008}
1009impl Default for GpsFixType {
1010 fn default() -> Self {
1011 Self::DEFAULT
1012 }
1013}
1014bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1015impl GpsInputIgnoreFlags {
1016 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1017}
1018impl Default for GpsInputIgnoreFlags {
1019 fn default() -> Self {
1020 Self::DEFAULT
1021 }
1022}
1023#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1024#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1025#[cfg_attr(feature = "serde", serde(tag = "type"))]
1026#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1027#[repr(u32)]
1028#[doc = "Signal jamming state in a GPS receiver."]
1029pub enum GpsJammingState {
1030 #[doc = "The GPS receiver does not provide GPS signal jamming info."]
1031 GPS_JAMMING_STATE_UNKNOWN = 0,
1032 #[doc = "The GPS receiver detected no signal jamming."]
1033 GPS_JAMMING_STATE_OK = 1,
1034 #[doc = "The GPS receiver detected and mitigated signal jamming."]
1035 GPS_JAMMING_STATE_MITIGATED = 2,
1036 #[doc = "The GPS receiver detected signal jamming."]
1037 GPS_JAMMING_STATE_DETECTED = 3,
1038}
1039impl GpsJammingState {
1040 pub const DEFAULT: Self = Self::GPS_JAMMING_STATE_UNKNOWN;
1041}
1042impl Default for GpsJammingState {
1043 fn default() -> Self {
1044 Self::DEFAULT
1045 }
1046}
1047#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1048#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1049#[cfg_attr(feature = "serde", serde(tag = "type"))]
1050#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1051#[repr(u32)]
1052#[doc = "State of RAIM processing."]
1053pub enum GpsRaimState {
1054 #[doc = "RAIM capability is unknown."]
1055 GPS_RAIM_STATE_UNKNOWN = 0,
1056 #[doc = "RAIM is disabled."]
1057 GPS_RAIM_STATE_DISABLED = 1,
1058 #[doc = "RAIM integrity check was successful."]
1059 GPS_RAIM_STATE_OK = 2,
1060 #[doc = "RAIM integrity check failed."]
1061 GPS_RAIM_STATE_FAILED = 3,
1062}
1063impl GpsRaimState {
1064 pub const DEFAULT: Self = Self::GPS_RAIM_STATE_UNKNOWN;
1065}
1066impl Default for GpsRaimState {
1067 fn default() -> Self {
1068 Self::DEFAULT
1069 }
1070}
1071#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1072#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1073#[cfg_attr(feature = "serde", serde(tag = "type"))]
1074#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1075#[repr(u32)]
1076#[doc = "Signal spoofing state in a GPS receiver."]
1077pub enum GpsSpoofingState {
1078 #[doc = "The GPS receiver does not provide GPS signal spoofing info."]
1079 GPS_SPOOFING_STATE_UNKNOWN = 0,
1080 #[doc = "The GPS receiver detected no signal spoofing."]
1081 GPS_SPOOFING_STATE_OK = 1,
1082 #[doc = "The GPS receiver detected and mitigated signal spoofing."]
1083 GPS_SPOOFING_STATE_MITIGATED = 2,
1084 #[doc = "The GPS receiver detected signal spoofing but still has a fix."]
1085 GPS_SPOOFING_STATE_DETECTED = 3,
1086}
1087impl GpsSpoofingState {
1088 pub const DEFAULT: Self = Self::GPS_SPOOFING_STATE_UNKNOWN;
1089}
1090impl Default for GpsSpoofingState {
1091 fn default() -> Self {
1092 Self::DEFAULT
1093 }
1094}
1095bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags indicating errors in a GPS receiver."] pub struct GpsSystemErrorFlags : u32 { # [doc = "There are problems with incoming correction streams."] const GPS_SYSTEM_ERROR_INCOMING_CORRECTIONS = 1 ; # [doc = "There are problems with the configuration."] const GPS_SYSTEM_ERROR_CONFIGURATION = 2 ; # [doc = "There are problems with the software on the GPS receiver."] const GPS_SYSTEM_ERROR_SOFTWARE = 4 ; # [doc = "There are problems with an antenna connected to the GPS receiver."] const GPS_SYSTEM_ERROR_ANTENNA = 8 ; # [doc = "There are problems handling all incoming events."] const GPS_SYSTEM_ERROR_EVENT_CONGESTION = 16 ; # [doc = "The GPS receiver CPU is overloaded."] const GPS_SYSTEM_ERROR_CPU_OVERLOAD = 32 ; # [doc = "The GPS receiver is experiencing output congestion."] const GPS_SYSTEM_ERROR_OUTPUT_CONGESTION = 64 ; } }
1096impl GpsSystemErrorFlags {
1097 pub const DEFAULT: Self = Self::GPS_SYSTEM_ERROR_INCOMING_CORRECTIONS;
1098}
1099impl Default for GpsSystemErrorFlags {
1100 fn default() -> Self {
1101 Self::DEFAULT
1102 }
1103}
1104#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1106#[cfg_attr(feature = "serde", serde(tag = "type"))]
1107#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1108#[repr(u32)]
1109#[doc = "Gripper actions."]
1110pub enum GripperActions {
1111 #[doc = "Gripper release cargo."]
1112 GRIPPER_ACTION_RELEASE = 0,
1113 #[doc = "Gripper grab onto cargo."]
1114 GRIPPER_ACTION_GRAB = 1,
1115}
1116impl GripperActions {
1117 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1118}
1119impl Default for GripperActions {
1120 fn default() -> Self {
1121 Self::DEFAULT
1122 }
1123}
1124bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1125impl HighresImuUpdatedFlags {
1126 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1127}
1128impl Default for HighresImuUpdatedFlags {
1129 fn default() -> Self {
1130 Self::DEFAULT
1131 }
1132}
1133bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1134impl HilActuatorControlsFlags {
1135 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1136}
1137impl Default for HilActuatorControlsFlags {
1138 fn default() -> Self {
1139 Self::DEFAULT
1140 }
1141}
1142bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1143impl HilSensorUpdatedFlags {
1144 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1145}
1146impl Default for HilSensorUpdatedFlags {
1147 fn default() -> Self {
1148 Self::DEFAULT
1149 }
1150}
1151bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1152impl HlFailureFlag {
1153 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1154}
1155impl Default for HlFailureFlag {
1156 fn default() -> Self {
1157 Self::DEFAULT
1158 }
1159}
1160bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1161impl IlluminatorErrorFlags {
1162 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1163}
1164impl Default for IlluminatorErrorFlags {
1165 fn default() -> Self {
1166 Self::DEFAULT
1167 }
1168}
1169#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1170#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1171#[cfg_attr(feature = "serde", serde(tag = "type"))]
1172#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1173#[repr(u32)]
1174#[doc = "Modes of illuminator"]
1175pub enum IlluminatorMode {
1176 #[doc = "Illuminator mode is not specified/unknown"]
1177 ILLUMINATOR_MODE_UNKNOWN = 0,
1178 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1179 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1180 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1181 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1182}
1183impl IlluminatorMode {
1184 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1185}
1186impl Default for IlluminatorMode {
1187 fn default() -> Self {
1188 Self::DEFAULT
1189 }
1190}
1191#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1192#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1193#[cfg_attr(feature = "serde", serde(tag = "type"))]
1194#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1195#[repr(u32)]
1196#[doc = "Type of landing target"]
1197pub enum LandingTargetType {
1198 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1199 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1200 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1201 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1202 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1203 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1204 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1205 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1206}
1207impl LandingTargetType {
1208 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1209}
1210impl Default for LandingTargetType {
1211 fn default() -> Self {
1212 Self::DEFAULT
1213 }
1214}
1215#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1216#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1217#[cfg_attr(feature = "serde", serde(tag = "type"))]
1218#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1219#[repr(u32)]
1220pub enum MagCalStatus {
1221 MAG_CAL_NOT_STARTED = 0,
1222 MAG_CAL_WAITING_TO_START = 1,
1223 MAG_CAL_RUNNING_STEP_ONE = 2,
1224 MAG_CAL_RUNNING_STEP_TWO = 3,
1225 MAG_CAL_SUCCESS = 4,
1226 MAG_CAL_FAILED = 5,
1227 MAG_CAL_BAD_ORIENTATION = 6,
1228 MAG_CAL_BAD_RADIUS = 7,
1229}
1230impl MagCalStatus {
1231 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1232}
1233impl Default for MagCalStatus {
1234 fn default() -> Self {
1235 Self::DEFAULT
1236 }
1237}
1238#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1240#[cfg_attr(feature = "serde", serde(tag = "type"))]
1241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1242#[repr(u32)]
1243pub enum MavArmAuthDeniedReason {
1244 #[doc = "Not a specific reason"]
1245 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1246 #[doc = "Authorizer will send the error as string to GCS"]
1247 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1248 #[doc = "At least one waypoint have a invalid value"]
1249 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1250 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1251 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1252 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1253 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1254 #[doc = "Weather is not good to fly"]
1255 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1256}
1257impl MavArmAuthDeniedReason {
1258 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1259}
1260impl Default for MavArmAuthDeniedReason {
1261 fn default() -> Self {
1262 Self::DEFAULT
1263 }
1264}
1265#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1266#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1267#[cfg_attr(feature = "serde", serde(tag = "type"))]
1268#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1269#[repr(u32)]
1270#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1271pub enum MavAutopilot {
1272 #[doc = "Generic autopilot, full support for everything"]
1273 MAV_AUTOPILOT_GENERIC = 0,
1274 #[doc = "Reserved for future use."]
1275 MAV_AUTOPILOT_RESERVED = 1,
1276 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1277 MAV_AUTOPILOT_SLUGS = 2,
1278 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1279 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1280 #[doc = "OpenPilot, <http://openpilot.org>"]
1281 MAV_AUTOPILOT_OPENPILOT = 4,
1282 #[doc = "Generic autopilot only supporting simple waypoints"]
1283 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1284 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1285 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1286 #[doc = "Generic autopilot supporting the full mission command set"]
1287 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1288 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1289 MAV_AUTOPILOT_INVALID = 8,
1290 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1291 MAV_AUTOPILOT_PPZ = 9,
1292 #[doc = "UAV Dev Board"]
1293 MAV_AUTOPILOT_UDB = 10,
1294 #[doc = "FlexiPilot"]
1295 MAV_AUTOPILOT_FP = 11,
1296 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1297 MAV_AUTOPILOT_PX4 = 12,
1298 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1299 MAV_AUTOPILOT_SMACCMPILOT = 13,
1300 #[doc = "AutoQuad -- <http://autoquad.org>"]
1301 MAV_AUTOPILOT_AUTOQUAD = 14,
1302 #[doc = "Armazila -- <http://armazila.com>"]
1303 MAV_AUTOPILOT_ARMAZILA = 15,
1304 #[doc = "Aerob -- <http://aerob.ru>"]
1305 MAV_AUTOPILOT_AEROB = 16,
1306 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1307 MAV_AUTOPILOT_ASLUAV = 17,
1308 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1309 MAV_AUTOPILOT_SMARTAP = 18,
1310 #[doc = "AirRails - <http://uaventure.com>"]
1311 MAV_AUTOPILOT_AIRRAILS = 19,
1312 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1313 MAV_AUTOPILOT_REFLEX = 20,
1314}
1315impl MavAutopilot {
1316 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1317}
1318impl Default for MavAutopilot {
1319 fn default() -> Self {
1320 Self::DEFAULT
1321 }
1322}
1323#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1324#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1325#[cfg_attr(feature = "serde", serde(tag = "type"))]
1326#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1327#[repr(u32)]
1328#[doc = "Enumeration for battery charge states."]
1329pub enum MavBatteryChargeState {
1330 #[doc = "Low battery state is not provided"]
1331 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1332 #[doc = "Battery is not in low state. Normal operation."]
1333 MAV_BATTERY_CHARGE_STATE_OK = 1,
1334 #[doc = "Battery state is low, warn and monitor close."]
1335 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1336 #[doc = "Battery state is critical, return or abort immediately."]
1337 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1338 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1339 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1340 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1341 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1342 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1343 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1344 #[doc = "Battery is charging."]
1345 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1346}
1347impl MavBatteryChargeState {
1348 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1349}
1350impl Default for MavBatteryChargeState {
1351 fn default() -> Self {
1352 Self::DEFAULT
1353 }
1354}
1355bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1356impl MavBatteryFault {
1357 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1358}
1359impl Default for MavBatteryFault {
1360 fn default() -> Self {
1361 Self::DEFAULT
1362 }
1363}
1364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1366#[cfg_attr(feature = "serde", serde(tag = "type"))]
1367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1368#[repr(u32)]
1369#[doc = "Enumeration of battery functions"]
1370pub enum MavBatteryFunction {
1371 #[doc = "Battery function is unknown"]
1372 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1373 #[doc = "Battery supports all flight systems"]
1374 MAV_BATTERY_FUNCTION_ALL = 1,
1375 #[doc = "Battery for the propulsion system"]
1376 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1377 #[doc = "Avionics battery"]
1378 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1379 #[doc = "Payload battery"]
1380 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1381}
1382impl MavBatteryFunction {
1383 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1384}
1385impl Default for MavBatteryFunction {
1386 fn default() -> Self {
1387 Self::DEFAULT
1388 }
1389}
1390#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1392#[cfg_attr(feature = "serde", serde(tag = "type"))]
1393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1394#[repr(u32)]
1395#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1396pub enum MavBatteryMode {
1397 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1398 MAV_BATTERY_MODE_UNKNOWN = 0,
1399 #[doc = "Battery is auto discharging (towards storage level)."]
1400 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1401 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1402 MAV_BATTERY_MODE_HOT_SWAP = 2,
1403}
1404impl MavBatteryMode {
1405 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1406}
1407impl Default for MavBatteryMode {
1408 fn default() -> Self {
1409 Self::DEFAULT
1410 }
1411}
1412bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Battery status flags for fault, health and state indication."] pub struct MavBatteryStatusFlags : u32 { # [doc = "The battery is not ready to use (fly). Set if the battery has faults or other conditions that make it unsafe to fly with. Note: It will be the logical OR of other status bits (chosen by the manufacturer/integrator)."] const MAV_BATTERY_STATUS_FLAGS_NOT_READY_TO_USE = 1 ; # [doc = "Battery is charging."] const MAV_BATTERY_STATUS_FLAGS_CHARGING = 2 ; # [doc = "Battery is cell balancing (during charging). Not ready to use (MAV_BATTERY_STATUS_FLAGS_NOT_READY_TO_USE may be set)."] const MAV_BATTERY_STATUS_FLAGS_CELL_BALANCING = 4 ; # [doc = "Battery cells are not balanced. Not ready to use."] const MAV_BATTERY_STATUS_FLAGS_FAULT_CELL_IMBALANCE = 8 ; # [doc = "Battery is auto discharging (towards storage level). Not ready to use (MAV_BATTERY_STATUS_FLAGS_NOT_READY_TO_USE would be set)."] const MAV_BATTERY_STATUS_FLAGS_AUTO_DISCHARGING = 16 ; # [doc = "Battery requires service (not safe to fly). This is set at vendor discretion. It is likely to be set for most faults, and may also be set according to a maintenance schedule (such as age, or number of recharge cycles, etc.)."] const MAV_BATTERY_STATUS_FLAGS_REQUIRES_SERVICE = 32 ; # [doc = "Battery is faulty and cannot be repaired (not safe to fly). This is set at vendor discretion. The battery should be disposed of safely."] const MAV_BATTERY_STATUS_FLAGS_BAD_BATTERY = 64 ; # [doc = "Automatic battery protection monitoring is enabled. When enabled, the system will monitor for certain kinds of faults, such as cells being over-voltage. If a fault is triggered then and protections are enabled then a safety fault (MAV_BATTERY_STATUS_FLAGS_FAULT_PROTECTION_SYSTEM) will be set and power from the battery will be stopped. Note that battery protection monitoring should only be enabled when the vehicle is landed. Once the vehicle is armed, or starts moving, the protections should be disabled to prevent false positives from disabling the output."] const MAV_BATTERY_STATUS_FLAGS_PROTECTIONS_ENABLED = 128 ; # [doc = "The battery fault protection system had detected a fault and cut all power from the battery. This will only trigger if MAV_BATTERY_STATUS_FLAGS_PROTECTIONS_ENABLED is set. Other faults like MAV_BATTERY_STATUS_FLAGS_FAULT_OVER_VOLT may also be set, indicating the cause of the protection fault."] const MAV_BATTERY_STATUS_FLAGS_FAULT_PROTECTION_SYSTEM = 256 ; # [doc = "One or more cells are above their maximum voltage rating."] const MAV_BATTERY_STATUS_FLAGS_FAULT_OVER_VOLT = 512 ; # [doc = "One or more cells are below their minimum voltage rating. A battery that had deep-discharged might be irrepairably damaged, and set both MAV_BATTERY_STATUS_FLAGS_FAULT_UNDER_VOLT and MAV_BATTERY_STATUS_FLAGS_BAD_BATTERY."] const MAV_BATTERY_STATUS_FLAGS_FAULT_UNDER_VOLT = 1024 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_STATUS_FLAGS_FAULT_OVER_TEMPERATURE = 2048 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_STATUS_FLAGS_FAULT_UNDER_TEMPERATURE = 4096 ; # [doc = "Over-current fault."] const MAV_BATTERY_STATUS_FLAGS_FAULT_OVER_CURRENT = 8192 ; # [doc = "Short circuit event detected. The battery may or may not be safe to use (check other flags)."] const MAV_BATTERY_STATUS_FLAGS_FAULT_SHORT_CIRCUIT = 16384 ; # [doc = "Voltage not compatible with power rail voltage (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_STATUS_FLAGS_FAULT_INCOMPATIBLE_VOLTAGE = 32768 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_STATUS_FLAGS_FAULT_INCOMPATIBLE_FIRMWARE = 65536 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const MAV_BATTERY_STATUS_FLAGS_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 131072 ; # [doc = "Battery capacity_consumed and capacity_remaining values are relative to a full battery (they sum to the total capacity of the battery). This flag would be set for a smart battery that can accurately determine its remaining charge across vehicle reboots and discharge/recharge cycles. If unset the capacity_consumed indicates the consumption since vehicle power-on, as measured using a power monitor. The capacity_remaining, if provided, indicates the estimated remaining capacity on the assumption that the battery was full on vehicle boot. If unset a GCS is recommended to advise that users fully charge the battery on power on."] const MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL = 262144 ; # [doc = "Reserved (not used). If set, this will indicate that an additional status field exists for higher status values."] const MAV_BATTERY_STATUS_FLAGS_EXTENDED = 2147483648 ; } }
1413impl MavBatteryStatusFlags {
1414 pub const DEFAULT: Self = Self::MAV_BATTERY_STATUS_FLAGS_NOT_READY_TO_USE;
1415}
1416impl Default for MavBatteryStatusFlags {
1417 fn default() -> Self {
1418 Self::DEFAULT
1419 }
1420}
1421#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1423#[cfg_attr(feature = "serde", serde(tag = "type"))]
1424#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1425#[repr(u32)]
1426#[doc = "Enumeration of battery types"]
1427pub enum MavBatteryType {
1428 #[doc = "Not specified."]
1429 MAV_BATTERY_TYPE_UNKNOWN = 0,
1430 #[doc = "Lithium polymer battery"]
1431 MAV_BATTERY_TYPE_LIPO = 1,
1432 #[doc = "Lithium-iron-phosphate battery"]
1433 MAV_BATTERY_TYPE_LIFE = 2,
1434 #[doc = "Lithium-ION battery"]
1435 MAV_BATTERY_TYPE_LION = 3,
1436 #[doc = "Nickel metal hydride battery"]
1437 MAV_BATTERY_TYPE_NIMH = 4,
1438}
1439impl MavBatteryType {
1440 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1441}
1442impl Default for MavBatteryType {
1443 fn default() -> Self {
1444 Self::DEFAULT
1445 }
1446}
1447#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1448#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1449#[cfg_attr(feature = "serde", serde(tag = "type"))]
1450#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1451#[repr(u32)]
1452#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1453pub enum MavCmd {
1454 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1455 MAV_CMD_NAV_WAYPOINT = 16,
1456 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1457 MAV_CMD_NAV_LOITER_UNLIM = 17,
1458 #[doc = "Loiter around this waypoint for X turns"]
1459 MAV_CMD_NAV_LOITER_TURNS = 18,
1460 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1461 MAV_CMD_NAV_LOITER_TIME = 19,
1462 #[doc = "Return to launch location"]
1463 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1464 #[doc = "Land at location."]
1465 MAV_CMD_NAV_LAND = 21,
1466 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1467 MAV_CMD_NAV_TAKEOFF = 22,
1468 #[doc = "Land at local position (local frame only)"]
1469 MAV_CMD_NAV_LAND_LOCAL = 23,
1470 #[doc = "Takeoff from local position (local frame only)"]
1471 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1472 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1473 MAV_CMD_NAV_FOLLOW = 25,
1474 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1475 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1476 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1477 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1478 #[doc = "Begin following a target"]
1479 MAV_CMD_DO_FOLLOW = 32,
1480 #[doc = "Reposition the MAV after a follow target command has been sent"]
1481 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1482 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1483 MAV_CMD_DO_ORBIT = 34,
1484 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1485 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1486 MAV_CMD_NAV_ROI = 80,
1487 #[doc = "Control autonomous path planning on the MAV."]
1488 MAV_CMD_NAV_PATHPLANNING = 81,
1489 #[doc = "Navigate to waypoint using a spline path."]
1490 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1491 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1492 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1493 #[doc = "Land using VTOL mode"]
1494 MAV_CMD_NAV_VTOL_LAND = 85,
1495 #[doc = "hand control over to an external controller"]
1496 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1497 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1498 MAV_CMD_NAV_DELAY = 93,
1499 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1500 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1501 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1502 MAV_CMD_NAV_LAST = 95,
1503 #[doc = "Delay mission state machine."]
1504 MAV_CMD_CONDITION_DELAY = 112,
1505 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1506 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1507 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1508 MAV_CMD_CONDITION_DISTANCE = 114,
1509 #[doc = "Reach a certain target angle."]
1510 MAV_CMD_CONDITION_YAW = 115,
1511 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1512 MAV_CMD_CONDITION_LAST = 159,
1513 #[doc = "Set system mode."]
1514 MAV_CMD_DO_SET_MODE = 176,
1515 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1516 MAV_CMD_DO_JUMP = 177,
1517 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1518 MAV_CMD_DO_CHANGE_SPEED = 178,
1519 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1520 MAV_CMD_DO_SET_HOME = 179,
1521 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1522 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1523 MAV_CMD_DO_SET_PARAMETER = 180,
1524 #[doc = "Set a relay to a condition."]
1525 MAV_CMD_DO_SET_RELAY = 181,
1526 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1527 MAV_CMD_DO_REPEAT_RELAY = 182,
1528 #[doc = "Set a servo to a desired PWM value."]
1529 MAV_CMD_DO_SET_SERVO = 183,
1530 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1531 MAV_CMD_DO_REPEAT_SERVO = 184,
1532 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1533 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1534 #[doc = "Change altitude set point."]
1535 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1536 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1537 MAV_CMD_DO_SET_ACTUATOR = 187,
1538 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1539 MAV_CMD_DO_RETURN_PATH_START = 188,
1540 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1541 MAV_CMD_DO_LAND_START = 189,
1542 #[doc = "Mission command to perform a landing from a rally point."]
1543 MAV_CMD_DO_RALLY_LAND = 190,
1544 #[doc = "Mission command to safely abort an autonomous landing."]
1545 MAV_CMD_DO_GO_AROUND = 191,
1546 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1547 MAV_CMD_DO_REPOSITION = 192,
1548 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1549 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1550 #[doc = "Set moving direction to forward or reverse."]
1551 MAV_CMD_DO_SET_REVERSE = 194,
1552 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1553 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1554 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1555 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1556 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1557 MAV_CMD_DO_SET_ROI_NONE = 197,
1558 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1559 MAV_CMD_DO_SET_ROI_SYSID = 198,
1560 #[doc = "Control onboard camera system."]
1561 MAV_CMD_DO_CONTROL_VIDEO = 200,
1562 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1563 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1564 MAV_CMD_DO_SET_ROI = 201,
1565 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1566 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1567 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1568 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1569 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1570 #[doc = "Mission command to configure a camera or antenna mount"]
1571 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1572 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1573 #[doc = "Mission command to control a camera or antenna mount"]
1574 MAV_CMD_DO_MOUNT_CONTROL = 205,
1575 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1576 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1577 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1578 MAV_CMD_DO_FENCE_ENABLE = 207,
1579 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1580 MAV_CMD_DO_PARACHUTE = 208,
1581 #[doc = "Command to perform motor test."]
1582 MAV_CMD_DO_MOTOR_TEST = 209,
1583 #[doc = "Change to/from inverted flight."]
1584 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1585 #[doc = "Mission command to operate a gripper."]
1586 MAV_CMD_DO_GRIPPER = 211,
1587 #[doc = "Enable/disable autotune."]
1588 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1589 #[doc = "Sets a desired vehicle turn angle and speed change."]
1590 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1591 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1592 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1593 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1594 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1595 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1596 #[doc = "set id of master controller"]
1597 MAV_CMD_DO_GUIDED_MASTER = 221,
1598 #[doc = "Set limits for external control"]
1599 MAV_CMD_DO_GUIDED_LIMITS = 222,
1600 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1601 MAV_CMD_DO_ENGINE_CONTROL = 223,
1602 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1603 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1604 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1605 MAV_CMD_DO_LAST = 240,
1606 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1607 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1608 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1609 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1610 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1611 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1612 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1613 MAV_CMD_PREFLIGHT_STORAGE = 245,
1614 #[doc = "Request the reboot or shutdown of system components."]
1615 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1616 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1617 MAV_CMD_OVERRIDE_GOTO = 252,
1618 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1619 MAV_CMD_OBLIQUE_SURVEY = 260,
1620 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1621 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1622 #[doc = "start running a mission"]
1623 MAV_CMD_MISSION_START = 300,
1624 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1625 MAV_CMD_ACTUATOR_TEST = 310,
1626 #[doc = "Actuator configuration command."]
1627 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1628 #[doc = "Arms / Disarms a component"]
1629 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1630 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1631 MAV_CMD_RUN_PREARM_CHECKS = 401,
1632 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1633 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1634 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1635 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1636 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1637 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1638 MAV_CMD_GET_HOME_POSITION = 410,
1639 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1640 MAV_CMD_INJECT_FAILURE = 420,
1641 #[doc = "Starts receiver pairing."]
1642 MAV_CMD_START_RX_PAIR = 500,
1643 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1644 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1645 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1646 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1647 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1648 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1649 MAV_CMD_REQUEST_MESSAGE = 512,
1650 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1651 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1652 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1653 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1654 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1655 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1656 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1657 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1658 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1659 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1660 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1661 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1662 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1663 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1664 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1665 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1666 MAV_CMD_STORAGE_FORMAT = 526,
1667 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1668 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1669 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1670 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1671 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1672 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1673 #[doc = "Reset all camera settings to Factory Default"]
1674 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1675 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1676 MAV_CMD_SET_CAMERA_MODE = 530,
1677 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1678 MAV_CMD_SET_CAMERA_ZOOM = 531,
1679 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1680 MAV_CMD_SET_CAMERA_FOCUS = 532,
1681 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1682 MAV_CMD_SET_STORAGE_USAGE = 533,
1683 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1684 MAV_CMD_SET_CAMERA_SOURCE = 534,
1685 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1686 MAV_CMD_JUMP_TAG = 600,
1687 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1688 MAV_CMD_DO_JUMP_TAG = 601,
1689 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1690 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1691 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1692 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1693 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1694 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1695 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1696 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1697 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1698 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1699 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1700 #[doc = "Enable or disable on-board camera triggering system."]
1701 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1702 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1703 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1704 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1705 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1706 #[doc = "Stops ongoing tracking."]
1707 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1708 #[doc = "Starts video capture (recording)."]
1709 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1710 #[doc = "Stop the current video capture (recording)."]
1711 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1712 #[doc = "Start video streaming"]
1713 MAV_CMD_VIDEO_START_STREAMING = 2502,
1714 #[doc = "Stop the given video stream"]
1715 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1716 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1717 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1718 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1719 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1720 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1721 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1722 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1723 MAV_CMD_LOGGING_START = 2510,
1724 #[doc = "Request to stop streaming log data over MAVLink"]
1725 MAV_CMD_LOGGING_STOP = 2511,
1726 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1727 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1728 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1729 #[doc = "Create a panorama at the current position"]
1730 MAV_CMD_PANORAMA_CREATE = 2800,
1731 #[doc = "Request VTOL transition"]
1732 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1733 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1734 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1735 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1736 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1737 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1738 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1739 #[doc = "Delay mission state machine until gate has been reached."]
1740 MAV_CMD_CONDITION_GATE = 4501,
1741 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1742 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1743 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1744 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1745 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1746 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1747 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1748 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1749 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1750 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1751 #[doc = "Rally point. You can have multiple rally points defined."]
1752 MAV_CMD_NAV_RALLY_POINT = 5100,
1753 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1754 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1755 #[doc = "Change state of safety switch."]
1756 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1757 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1758 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1759 #[deprecated = " (Deprecated since 2021-06)"]
1760 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1761 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1762 #[deprecated = " (Deprecated since 2021-06)"]
1763 #[doc = "Control the payload deployment."]
1764 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1765 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1766 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1767 #[doc = "Command to operate winch."]
1768 MAV_CMD_DO_WINCH = 42600,
1769 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1770 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1771 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1772 MAV_CMD_WAYPOINT_USER_1 = 31000,
1773 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1774 MAV_CMD_WAYPOINT_USER_2 = 31001,
1775 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1776 MAV_CMD_WAYPOINT_USER_3 = 31002,
1777 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1778 MAV_CMD_WAYPOINT_USER_4 = 31003,
1779 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1780 MAV_CMD_WAYPOINT_USER_5 = 31004,
1781 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1782 MAV_CMD_SPATIAL_USER_1 = 31005,
1783 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1784 MAV_CMD_SPATIAL_USER_2 = 31006,
1785 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1786 MAV_CMD_SPATIAL_USER_3 = 31007,
1787 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1788 MAV_CMD_SPATIAL_USER_4 = 31008,
1789 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1790 MAV_CMD_SPATIAL_USER_5 = 31009,
1791 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1792 MAV_CMD_USER_1 = 31010,
1793 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1794 MAV_CMD_USER_2 = 31011,
1795 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1796 MAV_CMD_USER_3 = 31012,
1797 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1798 MAV_CMD_USER_4 = 31013,
1799 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1800 MAV_CMD_USER_5 = 31014,
1801 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1802 MAV_CMD_CAN_FORWARD = 32000,
1803 #[doc = "Fly a figure eight path as defined by the parameters. Set parameters to NaN/INT32_MAX (as appropriate) to use system-default values. The command is intended for fixed wing vehicles (and VTOL hybrids flying in fixed-wing mode), allowing POI tracking for gimbals that don't support infinite rotation. This command only defines the flight path. Speed should be set independently (use e.g. MAV_CMD_DO_CHANGE_SPEED). Yaw and other degrees of freedom are not specified, and will be flight-stack specific (on vehicles where they can be controlled independent of the heading)."]
1804 MAV_CMD_DO_FIGURE_EIGHT = 35,
1805 #[doc = "Request a target system to start an upgrade of one (or all) of its components. For example, the command might be sent to a companion computer to cause it to upgrade a connected flight controller. The system doing the upgrade will report progress using the normal command protocol sequence for a long running operation. Command protocol information: <https://mavlink.io/en/services/command.html>."]
1806 MAV_CMD_DO_UPGRADE = 247,
1807 #[doc = "Allows setting an AT S command of an SiK radio."]
1808 MAV_CMD_SET_AT_S_PARAM = 550,
1809 #[doc = "Set system and component id. This allows moving of a system and all its components to a new system id, or moving a particular component to a new system/component id. Recipients must reject command addressed to broadcast system ID."]
1810 MAV_CMD_DO_SET_SYS_CMP_ID = 610,
1811 #[doc = "Sets the GNSS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GNSS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor. This command supersedes SET_GPS_GLOBAL_ORIGIN. Should be sent in a COMMAND_INT (Expected frame is MAV_FRAME_GLOBAL, and this should be assumed when sent in COMMAND_LONG)."]
1812 MAV_CMD_DO_SET_GLOBAL_ORIGIN = 611,
1813 #[doc = "Used to manually set/unset emergency status for remote id. This is for compliance with MOC ASTM docs, specifically F358 section 7.7: \"Emergency Status Indicator\". The requirement can also be satisfied by automatic setting of the emergency status by flight stack, and that approach is preferred. See <https://mavlink.io/en/services/opendroneid.html> for more information."]
1814 MAV_CMD_ODID_SET_EMERGENCY = 12900,
1815 #[doc = "Set an external estimate of wind direction and speed. This might be used to provide an initial wind estimate to the estimator (EKF) in the case where the vehicle is wind dead-reckoning, extending the time when operating without GPS before before position drift builds to an unsafe level. For this use case the command might reasonably be sent every few minutes when operating at altitude, and the value is cleared if the estimator resets itself."]
1816 MAV_CMD_EXTERNAL_WIND_ESTIMATE = 43004,
1817 #[doc = "Request GCS control of a system (or of a specific component in a system). A controlled system should only accept MAVLink commands and command-like messages that are sent by its controlling GCS, or from other components with the same system id. Commands from other systems should be rejected with MAV_RESULT_FAILED (except for this command, which may be acknowledged with MAV_RESULT_ACCEPTED if control is granted). Command-like messages should be ignored (or rejected if that is supported by their associated protocol). GCS control of the whole system is managed via a single component that we will refer to here as the \"system manager component\". This component streams the CONTROL_STATUS message and sets the GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER flag. Other components in the system should monitor for the CONTROL_STATUS message with this flag, and set their controlling GCS to match its published system id. A GCS that wants to control the system should also monitor for the same message and flag, and address the MAV_CMD_REQUEST_OPERATOR_CONTROL to its component id. Note that integrators are required to ensure that there is only one system manager component in the system (i.e. one component emitting the message with GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER set). The MAV_CMD_REQUEST_OPERATOR_CONTROL command is sent by a GCS to the system manager component to request or release control of a system, specifying whether subsequent takeover requests from another GCS are automatically granted, or require permission. The system manager component should grant control to the GCS if the system does not require takeover permission (or is uncontrolled) and ACK the request with MAV_RESULT_ACCEPTED. The system manager component should then stream CONTROL_STATUS indicating its controlling system: all other components with the same system id should monitor this message and set their own controlling GCS to match that of the system manager component. If the system manager component cannot grant control (because takeover requires permission), the request should be rejected with MAV_RESULT_FAILED. The system manager component should then send this same command to the current owning GCS in order to notify of the request. The owning GCS would ACK with MAV_RESULT_ACCEPTED, and might choose to release control of the vehicle, or re-request control with the takeover bit set to allow permission. In case it choses to re-request control with takeover bit set to allow permission, requestor GCS will only have 10 seconds to get control, otherwise owning GCS will re-request control with takeover bit set to disallow permission, and requestor GCS will need repeat the request if still interested in getting control. Note that the pilots of both GCS should co-ordinate safe handover offline. Note that in most systems the only controlled component will be the \"system manager component\", and that will be the autopilot. However separate GCS control of a particular component is also permitted, if supported by the component. In this case the GCS will address MAV_CMD_REQUEST_OPERATOR_CONTROL to the specific component it wants to control. The component will then stream CONTROL_STATUS for its controlling GCS (it must not set GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER). The component should fall back to the system GCS (if any) when it is not directly controlled, and may stop emitting CONTROL_STATUS. The flow is otherwise the same as for requesting control over the whole system."]
1818 MAV_CMD_REQUEST_OPERATOR_CONTROL = 32100,
1819}
1820impl MavCmd {
1821 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1822}
1823impl Default for MavCmd {
1824 fn default() -> Self {
1825 Self::DEFAULT
1826 }
1827}
1828#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1830#[cfg_attr(feature = "serde", serde(tag = "type"))]
1831#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1832#[repr(u32)]
1833#[doc = "Possible actions an aircraft can take to avoid a collision."]
1834pub enum MavCollisionAction {
1835 #[doc = "Ignore any potential collisions"]
1836 MAV_COLLISION_ACTION_NONE = 0,
1837 #[doc = "Report potential collision"]
1838 MAV_COLLISION_ACTION_REPORT = 1,
1839 #[doc = "Ascend or Descend to avoid threat"]
1840 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1841 #[doc = "Move horizontally to avoid threat"]
1842 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1843 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1844 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1845 #[doc = "Aircraft to fly directly back to its launch point"]
1846 MAV_COLLISION_ACTION_RTL = 5,
1847 #[doc = "Aircraft to stop in place"]
1848 MAV_COLLISION_ACTION_HOVER = 6,
1849}
1850impl MavCollisionAction {
1851 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1852}
1853impl Default for MavCollisionAction {
1854 fn default() -> Self {
1855 Self::DEFAULT
1856 }
1857}
1858#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1859#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1860#[cfg_attr(feature = "serde", serde(tag = "type"))]
1861#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1862#[repr(u32)]
1863#[doc = "Source of information about this collision."]
1864pub enum MavCollisionSrc {
1865 #[doc = "ID field references ADSB_VEHICLE packets"]
1866 MAV_COLLISION_SRC_ADSB = 0,
1867 #[doc = "ID field references MAVLink SRC ID"]
1868 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1869}
1870impl MavCollisionSrc {
1871 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1872}
1873impl Default for MavCollisionSrc {
1874 fn default() -> Self {
1875 Self::DEFAULT
1876 }
1877}
1878#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1879#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1880#[cfg_attr(feature = "serde", serde(tag = "type"))]
1881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1882#[repr(u32)]
1883#[doc = "Aircraft-rated danger from this threat."]
1884pub enum MavCollisionThreatLevel {
1885 #[doc = "Not a threat"]
1886 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1887 #[doc = "Craft is mildly concerned about this threat"]
1888 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1889 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1890 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1891}
1892impl MavCollisionThreatLevel {
1893 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1894}
1895impl Default for MavCollisionThreatLevel {
1896 fn default() -> Self {
1897 Self::DEFAULT
1898 }
1899}
1900#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1901#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1902#[cfg_attr(feature = "serde", serde(tag = "type"))]
1903#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1904#[repr(u32)]
1905#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1906pub enum MavComponent {
1907 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1908 MAV_COMP_ID_ALL = 0,
1909 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1910 MAV_COMP_ID_AUTOPILOT1 = 1,
1911 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1912 MAV_COMP_ID_USER1 = 25,
1913 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1914 MAV_COMP_ID_USER2 = 26,
1915 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1916 MAV_COMP_ID_USER3 = 27,
1917 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1918 MAV_COMP_ID_USER4 = 28,
1919 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1920 MAV_COMP_ID_USER5 = 29,
1921 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1922 MAV_COMP_ID_USER6 = 30,
1923 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1924 MAV_COMP_ID_USER7 = 31,
1925 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1926 MAV_COMP_ID_USER8 = 32,
1927 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1928 MAV_COMP_ID_USER9 = 33,
1929 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1930 MAV_COMP_ID_USER10 = 34,
1931 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1932 MAV_COMP_ID_USER11 = 35,
1933 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1934 MAV_COMP_ID_USER12 = 36,
1935 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1936 MAV_COMP_ID_USER13 = 37,
1937 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1938 MAV_COMP_ID_USER14 = 38,
1939 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1940 MAV_COMP_ID_USER15 = 39,
1941 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1942 MAV_COMP_ID_USER16 = 40,
1943 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1944 MAV_COMP_ID_USER17 = 41,
1945 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1946 MAV_COMP_ID_USER18 = 42,
1947 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1948 MAV_COMP_ID_USER19 = 43,
1949 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1950 MAV_COMP_ID_USER20 = 44,
1951 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1952 MAV_COMP_ID_USER21 = 45,
1953 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1954 MAV_COMP_ID_USER22 = 46,
1955 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1956 MAV_COMP_ID_USER23 = 47,
1957 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1958 MAV_COMP_ID_USER24 = 48,
1959 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1960 MAV_COMP_ID_USER25 = 49,
1961 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1962 MAV_COMP_ID_USER26 = 50,
1963 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1964 MAV_COMP_ID_USER27 = 51,
1965 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1966 MAV_COMP_ID_USER28 = 52,
1967 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1968 MAV_COMP_ID_USER29 = 53,
1969 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1970 MAV_COMP_ID_USER30 = 54,
1971 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1972 MAV_COMP_ID_USER31 = 55,
1973 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1974 MAV_COMP_ID_USER32 = 56,
1975 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1976 MAV_COMP_ID_USER33 = 57,
1977 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1978 MAV_COMP_ID_USER34 = 58,
1979 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1980 MAV_COMP_ID_USER35 = 59,
1981 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1982 MAV_COMP_ID_USER36 = 60,
1983 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1984 MAV_COMP_ID_USER37 = 61,
1985 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1986 MAV_COMP_ID_USER38 = 62,
1987 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1988 MAV_COMP_ID_USER39 = 63,
1989 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1990 MAV_COMP_ID_USER40 = 64,
1991 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1992 MAV_COMP_ID_USER41 = 65,
1993 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1994 MAV_COMP_ID_USER42 = 66,
1995 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1996 MAV_COMP_ID_USER43 = 67,
1997 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1998 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1999 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2000 MAV_COMP_ID_USER45 = 69,
2001 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2002 MAV_COMP_ID_USER46 = 70,
2003 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2004 MAV_COMP_ID_USER47 = 71,
2005 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2006 MAV_COMP_ID_USER48 = 72,
2007 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2008 MAV_COMP_ID_USER49 = 73,
2009 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2010 MAV_COMP_ID_USER50 = 74,
2011 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2012 MAV_COMP_ID_USER51 = 75,
2013 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2014 MAV_COMP_ID_USER52 = 76,
2015 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2016 MAV_COMP_ID_USER53 = 77,
2017 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2018 MAV_COMP_ID_USER54 = 78,
2019 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2020 MAV_COMP_ID_USER55 = 79,
2021 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2022 MAV_COMP_ID_USER56 = 80,
2023 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2024 MAV_COMP_ID_USER57 = 81,
2025 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2026 MAV_COMP_ID_USER58 = 82,
2027 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2028 MAV_COMP_ID_USER59 = 83,
2029 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2030 MAV_COMP_ID_USER60 = 84,
2031 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2032 MAV_COMP_ID_USER61 = 85,
2033 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2034 MAV_COMP_ID_USER62 = 86,
2035 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2036 MAV_COMP_ID_USER63 = 87,
2037 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2038 MAV_COMP_ID_USER64 = 88,
2039 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2040 MAV_COMP_ID_USER65 = 89,
2041 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2042 MAV_COMP_ID_USER66 = 90,
2043 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2044 MAV_COMP_ID_USER67 = 91,
2045 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2046 MAV_COMP_ID_USER68 = 92,
2047 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2048 MAV_COMP_ID_USER69 = 93,
2049 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2050 MAV_COMP_ID_USER70 = 94,
2051 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2052 MAV_COMP_ID_USER71 = 95,
2053 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2054 MAV_COMP_ID_USER72 = 96,
2055 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2056 MAV_COMP_ID_USER73 = 97,
2057 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2058 MAV_COMP_ID_USER74 = 98,
2059 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2060 MAV_COMP_ID_USER75 = 99,
2061 #[doc = "Camera #1."]
2062 MAV_COMP_ID_CAMERA = 100,
2063 #[doc = "Camera #2."]
2064 MAV_COMP_ID_CAMERA2 = 101,
2065 #[doc = "Camera #3."]
2066 MAV_COMP_ID_CAMERA3 = 102,
2067 #[doc = "Camera #4."]
2068 MAV_COMP_ID_CAMERA4 = 103,
2069 #[doc = "Camera #5."]
2070 MAV_COMP_ID_CAMERA5 = 104,
2071 #[doc = "Camera #6."]
2072 MAV_COMP_ID_CAMERA6 = 105,
2073 #[doc = "Servo #1."]
2074 MAV_COMP_ID_SERVO1 = 140,
2075 #[doc = "Servo #2."]
2076 MAV_COMP_ID_SERVO2 = 141,
2077 #[doc = "Servo #3."]
2078 MAV_COMP_ID_SERVO3 = 142,
2079 #[doc = "Servo #4."]
2080 MAV_COMP_ID_SERVO4 = 143,
2081 #[doc = "Servo #5."]
2082 MAV_COMP_ID_SERVO5 = 144,
2083 #[doc = "Servo #6."]
2084 MAV_COMP_ID_SERVO6 = 145,
2085 #[doc = "Servo #7."]
2086 MAV_COMP_ID_SERVO7 = 146,
2087 #[doc = "Servo #8."]
2088 MAV_COMP_ID_SERVO8 = 147,
2089 #[doc = "Servo #9."]
2090 MAV_COMP_ID_SERVO9 = 148,
2091 #[doc = "Servo #10."]
2092 MAV_COMP_ID_SERVO10 = 149,
2093 #[doc = "Servo #11."]
2094 MAV_COMP_ID_SERVO11 = 150,
2095 #[doc = "Servo #12."]
2096 MAV_COMP_ID_SERVO12 = 151,
2097 #[doc = "Servo #13."]
2098 MAV_COMP_ID_SERVO13 = 152,
2099 #[doc = "Servo #14."]
2100 MAV_COMP_ID_SERVO14 = 153,
2101 #[doc = "Gimbal #1."]
2102 MAV_COMP_ID_GIMBAL = 154,
2103 #[doc = "Logging component."]
2104 MAV_COMP_ID_LOG = 155,
2105 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2106 MAV_COMP_ID_ADSB = 156,
2107 #[doc = "On Screen Display (OSD) devices for video links."]
2108 MAV_COMP_ID_OSD = 157,
2109 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2110 MAV_COMP_ID_PERIPHERAL = 158,
2111 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2112 #[doc = "Gimbal ID for QX1."]
2113 MAV_COMP_ID_QX1_GIMBAL = 159,
2114 #[doc = "FLARM collision alert component."]
2115 MAV_COMP_ID_FLARM = 160,
2116 #[doc = "Parachute component."]
2117 MAV_COMP_ID_PARACHUTE = 161,
2118 #[doc = "Winch component."]
2119 MAV_COMP_ID_WINCH = 169,
2120 #[doc = "Gimbal #2."]
2121 MAV_COMP_ID_GIMBAL2 = 171,
2122 #[doc = "Gimbal #3."]
2123 MAV_COMP_ID_GIMBAL3 = 172,
2124 #[doc = "Gimbal #4"]
2125 MAV_COMP_ID_GIMBAL4 = 173,
2126 #[doc = "Gimbal #5."]
2127 MAV_COMP_ID_GIMBAL5 = 174,
2128 #[doc = "Gimbal #6."]
2129 MAV_COMP_ID_GIMBAL6 = 175,
2130 #[doc = "Battery #1."]
2131 MAV_COMP_ID_BATTERY = 180,
2132 #[doc = "Battery #2."]
2133 MAV_COMP_ID_BATTERY2 = 181,
2134 #[doc = "CAN over MAVLink client."]
2135 MAV_COMP_ID_MAVCAN = 189,
2136 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2137 MAV_COMP_ID_MISSIONPLANNER = 190,
2138 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2139 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2140 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2141 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2142 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2143 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2144 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2145 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2146 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2147 MAV_COMP_ID_PATHPLANNER = 195,
2148 #[doc = "Component that plans a collision free path between two points."]
2149 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2150 #[doc = "Component that provides position estimates using VIO techniques."]
2151 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2152 #[doc = "Component that manages pairing of vehicle and GCS."]
2153 MAV_COMP_ID_PAIRING_MANAGER = 198,
2154 #[doc = "Inertial Measurement Unit (IMU) #1."]
2155 MAV_COMP_ID_IMU = 200,
2156 #[doc = "Inertial Measurement Unit (IMU) #2."]
2157 MAV_COMP_ID_IMU_2 = 201,
2158 #[doc = "Inertial Measurement Unit (IMU) #3."]
2159 MAV_COMP_ID_IMU_3 = 202,
2160 #[doc = "GPS #1."]
2161 MAV_COMP_ID_GPS = 220,
2162 #[doc = "GPS #2."]
2163 MAV_COMP_ID_GPS2 = 221,
2164 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2165 MAV_COMP_ID_ODID_TXRX_1 = 236,
2166 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2167 MAV_COMP_ID_ODID_TXRX_2 = 237,
2168 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2169 MAV_COMP_ID_ODID_TXRX_3 = 238,
2170 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2171 MAV_COMP_ID_UDP_BRIDGE = 240,
2172 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2173 MAV_COMP_ID_UART_BRIDGE = 241,
2174 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2175 MAV_COMP_ID_TUNNEL_NODE = 242,
2176 #[doc = "Illuminator"]
2177 MAV_COMP_ID_ILLUMINATOR = 243,
2178 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2179 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2180 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2181}
2182impl MavComponent {
2183 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2184}
2185impl Default for MavComponent {
2186 fn default() -> Self {
2187 Self::DEFAULT
2188 }
2189}
2190#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2191#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2192#[cfg_attr(feature = "serde", serde(tag = "type"))]
2193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2194#[repr(u32)]
2195#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2196#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2197pub enum MavDataStream {
2198 #[doc = "Enable all data streams"]
2199 MAV_DATA_STREAM_ALL = 0,
2200 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2201 MAV_DATA_STREAM_RAW_SENSORS = 1,
2202 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2203 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2204 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2205 MAV_DATA_STREAM_RC_CHANNELS = 3,
2206 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2207 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2208 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2209 MAV_DATA_STREAM_POSITION = 6,
2210 #[doc = "Dependent on the autopilot"]
2211 MAV_DATA_STREAM_EXTRA1 = 10,
2212 #[doc = "Dependent on the autopilot"]
2213 MAV_DATA_STREAM_EXTRA2 = 11,
2214 #[doc = "Dependent on the autopilot"]
2215 MAV_DATA_STREAM_EXTRA3 = 12,
2216}
2217impl MavDataStream {
2218 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2219}
2220impl Default for MavDataStream {
2221 fn default() -> Self {
2222 Self::DEFAULT
2223 }
2224}
2225#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2226#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2227#[cfg_attr(feature = "serde", serde(tag = "type"))]
2228#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2229#[repr(u32)]
2230#[doc = "Enumeration of distance sensor types"]
2231pub enum MavDistanceSensor {
2232 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2233 MAV_DISTANCE_SENSOR_LASER = 0,
2234 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2235 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2236 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2237 MAV_DISTANCE_SENSOR_INFRARED = 2,
2238 #[doc = "Radar type, e.g. uLanding units"]
2239 MAV_DISTANCE_SENSOR_RADAR = 3,
2240 #[doc = "Broken or unknown type, e.g. analog units"]
2241 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2242}
2243impl MavDistanceSensor {
2244 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2245}
2246impl Default for MavDistanceSensor {
2247 fn default() -> Self {
2248 Self::DEFAULT
2249 }
2250}
2251#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2252#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2253#[cfg_attr(feature = "serde", serde(tag = "type"))]
2254#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2255#[repr(u32)]
2256#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2257pub enum MavDoRepositionFlags {
2258 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2259 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2260}
2261impl MavDoRepositionFlags {
2262 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2263}
2264impl Default for MavDoRepositionFlags {
2265 fn default() -> Self {
2266 Self::DEFAULT
2267 }
2268}
2269#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2271#[cfg_attr(feature = "serde", serde(tag = "type"))]
2272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2273#[repr(u32)]
2274#[doc = "Enumeration of estimator types"]
2275pub enum MavEstimatorType {
2276 #[doc = "Unknown type of the estimator."]
2277 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2278 #[doc = "This is a naive estimator without any real covariance feedback."]
2279 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2280 #[doc = "Computer vision based estimate. Might be up to scale."]
2281 MAV_ESTIMATOR_TYPE_VISION = 2,
2282 #[doc = "Visual-inertial estimate."]
2283 MAV_ESTIMATOR_TYPE_VIO = 3,
2284 #[doc = "Plain GPS estimate."]
2285 MAV_ESTIMATOR_TYPE_GPS = 4,
2286 #[doc = "Estimator integrating GPS and inertial sensing."]
2287 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2288 #[doc = "Estimate from external motion capturing system."]
2289 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2290 #[doc = "Estimator based on lidar sensor input."]
2291 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2292 #[doc = "Estimator on autopilot."]
2293 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2294}
2295impl MavEstimatorType {
2296 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2297}
2298impl Default for MavEstimatorType {
2299 fn default() -> Self {
2300 Self::DEFAULT
2301 }
2302}
2303#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2304#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2305#[cfg_attr(feature = "serde", serde(tag = "type"))]
2306#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2307#[repr(u32)]
2308#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2309pub enum MavEventCurrentSequenceFlags {
2310 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2311 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2312}
2313impl MavEventCurrentSequenceFlags {
2314 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2315}
2316impl Default for MavEventCurrentSequenceFlags {
2317 fn default() -> Self {
2318 Self::DEFAULT
2319 }
2320}
2321#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2322#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2323#[cfg_attr(feature = "serde", serde(tag = "type"))]
2324#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2325#[repr(u32)]
2326#[doc = "Reason for an event error response."]
2327pub enum MavEventErrorReason {
2328 #[doc = "The requested event is not available (anymore)."]
2329 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2330}
2331impl MavEventErrorReason {
2332 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2333}
2334impl Default for MavEventErrorReason {
2335 fn default() -> Self {
2336 Self::DEFAULT
2337 }
2338}
2339#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2341#[cfg_attr(feature = "serde", serde(tag = "type"))]
2342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2343#[repr(u32)]
2344#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2345pub enum MavFrame {
2346 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2347 MAV_FRAME_GLOBAL = 0,
2348 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2349 MAV_FRAME_LOCAL_NED = 1,
2350 #[doc = "NOT a coordinate frame, indicates a mission command."]
2351 MAV_FRAME_MISSION = 2,
2352 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2353 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2354 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2355 MAV_FRAME_LOCAL_ENU = 4,
2356 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2357 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2358 MAV_FRAME_GLOBAL_INT = 5,
2359 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2360 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2361 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2362 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2363 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2364 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2365 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2366 MAV_FRAME_BODY_NED = 8,
2367 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2368 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2369 MAV_FRAME_BODY_OFFSET_NED = 9,
2370 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2371 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2372 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2373 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2374 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2375 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2376 MAV_FRAME_BODY_FRD = 12,
2377 #[deprecated = " (Deprecated since 2019-04)"]
2378 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2379 MAV_FRAME_RESERVED_13 = 13,
2380 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2381 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2382 MAV_FRAME_RESERVED_14 = 14,
2383 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2384 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2385 MAV_FRAME_RESERVED_15 = 15,
2386 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2387 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2388 MAV_FRAME_RESERVED_16 = 16,
2389 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2390 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2391 MAV_FRAME_RESERVED_17 = 17,
2392 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2393 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2394 MAV_FRAME_RESERVED_18 = 18,
2395 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2396 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2397 MAV_FRAME_RESERVED_19 = 19,
2398 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2399 MAV_FRAME_LOCAL_FRD = 20,
2400 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2401 MAV_FRAME_LOCAL_FLU = 21,
2402}
2403impl MavFrame {
2404 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2405}
2406impl Default for MavFrame {
2407 fn default() -> Self {
2408 Self::DEFAULT
2409 }
2410}
2411#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2412#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2413#[cfg_attr(feature = "serde", serde(tag = "type"))]
2414#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2415#[repr(u32)]
2416#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2417pub enum MavFtpErr {
2418 #[doc = "None: No error"]
2419 MAV_FTP_ERR_NONE = 0,
2420 #[doc = "Fail: Unknown failure"]
2421 MAV_FTP_ERR_FAIL = 1,
2422 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2423 MAV_FTP_ERR_FAILERRNO = 2,
2424 #[doc = "InvalidDataSize: Payload size is invalid"]
2425 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2426 #[doc = "InvalidSession: Session is not currently open"]
2427 MAV_FTP_ERR_INVALIDSESSION = 4,
2428 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2429 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2430 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2431 MAV_FTP_ERR_EOF = 6,
2432 #[doc = "UnknownCommand: Unknown command / opcode"]
2433 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2434 #[doc = "FileExists: File/directory already exists"]
2435 MAV_FTP_ERR_FILEEXISTS = 8,
2436 #[doc = "FileProtected: File/directory is write protected"]
2437 MAV_FTP_ERR_FILEPROTECTED = 9,
2438 #[doc = "FileNotFound: File/directory not found"]
2439 MAV_FTP_ERR_FILENOTFOUND = 10,
2440}
2441impl MavFtpErr {
2442 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2443}
2444impl Default for MavFtpErr {
2445 fn default() -> Self {
2446 Self::DEFAULT
2447 }
2448}
2449#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2451#[cfg_attr(feature = "serde", serde(tag = "type"))]
2452#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2453#[repr(u32)]
2454#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2455pub enum MavFtpOpcode {
2456 #[doc = "None. Ignored, always ACKed"]
2457 MAV_FTP_OPCODE_NONE = 0,
2458 #[doc = "TerminateSession: Terminates open Read session"]
2459 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2460 #[doc = "ResetSessions: Terminates all open read sessions"]
2461 MAV_FTP_OPCODE_RESETSESSION = 2,
2462 #[doc = "ListDirectory. List files and directories in path from offset"]
2463 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2464 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2465 MAV_FTP_OPCODE_OPENFILERO = 4,
2466 #[doc = "ReadFile: Reads size bytes from offset in session"]
2467 MAV_FTP_OPCODE_READFILE = 5,
2468 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2469 MAV_FTP_OPCODE_CREATEFILE = 6,
2470 #[doc = "WriteFile: Writes size bytes to offset in session"]
2471 MAV_FTP_OPCODE_WRITEFILE = 7,
2472 #[doc = "RemoveFile: Remove file at path"]
2473 MAV_FTP_OPCODE_REMOVEFILE = 8,
2474 #[doc = "CreateDirectory: Creates directory at path"]
2475 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2476 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2477 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2478 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2479 MAV_FTP_OPCODE_OPENFILEWO = 11,
2480 #[doc = "TruncateFile: Truncate file at path to offset length"]
2481 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2482 #[doc = "Rename: Rename path1 to path2"]
2483 MAV_FTP_OPCODE_RENAME = 13,
2484 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2485 MAV_FTP_OPCODE_CALCFILECRC = 14,
2486 #[doc = "BurstReadFile: Burst download session file"]
2487 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2488 #[doc = "ACK: ACK response"]
2489 MAV_FTP_OPCODE_ACK = 128,
2490 #[doc = "NAK: NAK response"]
2491 MAV_FTP_OPCODE_NAK = 129,
2492}
2493impl MavFtpOpcode {
2494 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2495}
2496impl Default for MavFtpOpcode {
2497 fn default() -> Self {
2498 Self::DEFAULT
2499 }
2500}
2501#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2502#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2503#[cfg_attr(feature = "serde", serde(tag = "type"))]
2504#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2505#[repr(u32)]
2506#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2507pub enum MavFuelType {
2508 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2509 MAV_FUEL_TYPE_UNKNOWN = 0,
2510 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2511 MAV_FUEL_TYPE_LIQUID = 1,
2512 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2513 MAV_FUEL_TYPE_GAS = 2,
2514}
2515impl MavFuelType {
2516 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2517}
2518impl Default for MavFuelType {
2519 fn default() -> Self {
2520 Self::DEFAULT
2521 }
2522}
2523bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2524impl MavGeneratorStatusFlag {
2525 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2526}
2527impl Default for MavGeneratorStatusFlag {
2528 fn default() -> Self {
2529 Self::DEFAULT
2530 }
2531}
2532#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2533#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2534#[cfg_attr(feature = "serde", serde(tag = "type"))]
2535#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2536#[repr(u32)]
2537#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2538pub enum MavGoto {
2539 #[doc = "Hold at the current position."]
2540 MAV_GOTO_DO_HOLD = 0,
2541 #[doc = "Continue with the next item in mission execution."]
2542 MAV_GOTO_DO_CONTINUE = 1,
2543 #[doc = "Hold at the current position of the system"]
2544 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2545 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2546 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2547}
2548impl MavGoto {
2549 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2550}
2551impl Default for MavGoto {
2552 fn default() -> Self {
2553 Self::DEFAULT
2554 }
2555}
2556#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2557#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2558#[cfg_attr(feature = "serde", serde(tag = "type"))]
2559#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2560#[repr(u32)]
2561#[doc = "Enumeration of landed detector states"]
2562pub enum MavLandedState {
2563 #[doc = "MAV landed state is unknown"]
2564 MAV_LANDED_STATE_UNDEFINED = 0,
2565 #[doc = "MAV is landed (on ground)"]
2566 MAV_LANDED_STATE_ON_GROUND = 1,
2567 #[doc = "MAV is in air"]
2568 MAV_LANDED_STATE_IN_AIR = 2,
2569 #[doc = "MAV currently taking off"]
2570 MAV_LANDED_STATE_TAKEOFF = 3,
2571 #[doc = "MAV currently landing"]
2572 MAV_LANDED_STATE_LANDING = 4,
2573}
2574impl MavLandedState {
2575 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2576}
2577impl Default for MavLandedState {
2578 fn default() -> Self {
2579 Self::DEFAULT
2580 }
2581}
2582#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2583#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2584#[cfg_attr(feature = "serde", serde(tag = "type"))]
2585#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2586#[repr(u32)]
2587#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2588pub enum MavMissionResult {
2589 #[doc = "mission accepted OK"]
2590 MAV_MISSION_ACCEPTED = 0,
2591 #[doc = "Generic error / not accepting mission commands at all right now."]
2592 MAV_MISSION_ERROR = 1,
2593 #[doc = "Coordinate frame is not supported."]
2594 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2595 #[doc = "Command is not supported."]
2596 MAV_MISSION_UNSUPPORTED = 3,
2597 #[doc = "Mission items exceed storage space."]
2598 MAV_MISSION_NO_SPACE = 4,
2599 #[doc = "One of the parameters has an invalid value."]
2600 MAV_MISSION_INVALID = 5,
2601 #[doc = "param1 has an invalid value."]
2602 MAV_MISSION_INVALID_PARAM1 = 6,
2603 #[doc = "param2 has an invalid value."]
2604 MAV_MISSION_INVALID_PARAM2 = 7,
2605 #[doc = "param3 has an invalid value."]
2606 MAV_MISSION_INVALID_PARAM3 = 8,
2607 #[doc = "param4 has an invalid value."]
2608 MAV_MISSION_INVALID_PARAM4 = 9,
2609 #[doc = "x / param5 has an invalid value."]
2610 MAV_MISSION_INVALID_PARAM5_X = 10,
2611 #[doc = "y / param6 has an invalid value."]
2612 MAV_MISSION_INVALID_PARAM6_Y = 11,
2613 #[doc = "z / param7 has an invalid value."]
2614 MAV_MISSION_INVALID_PARAM7 = 12,
2615 #[doc = "Mission item received out of sequence"]
2616 MAV_MISSION_INVALID_SEQUENCE = 13,
2617 #[doc = "Not accepting any mission commands from this communication partner."]
2618 MAV_MISSION_DENIED = 14,
2619 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2620 MAV_MISSION_OPERATION_CANCELLED = 15,
2621}
2622impl MavMissionResult {
2623 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2624}
2625impl Default for MavMissionResult {
2626 fn default() -> Self {
2627 Self::DEFAULT
2628 }
2629}
2630#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2631#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2632#[cfg_attr(feature = "serde", serde(tag = "type"))]
2633#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2634#[repr(u32)]
2635#[doc = "Type of mission items being requested/sent in mission protocol."]
2636pub enum MavMissionType {
2637 #[doc = "Items are mission commands for main mission."]
2638 MAV_MISSION_TYPE_MISSION = 0,
2639 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2640 MAV_MISSION_TYPE_FENCE = 1,
2641 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2642 MAV_MISSION_TYPE_RALLY = 2,
2643 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2644 MAV_MISSION_TYPE_ALL = 255,
2645}
2646impl MavMissionType {
2647 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2648}
2649impl Default for MavMissionType {
2650 fn default() -> Self {
2651 Self::DEFAULT
2652 }
2653}
2654#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2656#[cfg_attr(feature = "serde", serde(tag = "type"))]
2657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2658#[repr(u32)]
2659#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2660pub enum MavMode {
2661 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2662 MAV_MODE_PREFLIGHT = 0,
2663 #[doc = "System is allowed to be active, under assisted RC control."]
2664 MAV_MODE_STABILIZE_DISARMED = 80,
2665 #[doc = "System is allowed to be active, under assisted RC control."]
2666 MAV_MODE_STABILIZE_ARMED = 208,
2667 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2668 MAV_MODE_MANUAL_DISARMED = 64,
2669 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2670 MAV_MODE_MANUAL_ARMED = 192,
2671 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2672 MAV_MODE_GUIDED_DISARMED = 88,
2673 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2674 MAV_MODE_GUIDED_ARMED = 216,
2675 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2676 MAV_MODE_AUTO_DISARMED = 92,
2677 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2678 MAV_MODE_AUTO_ARMED = 220,
2679 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2680 MAV_MODE_TEST_DISARMED = 66,
2681 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2682 MAV_MODE_TEST_ARMED = 194,
2683}
2684impl MavMode {
2685 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2686}
2687impl Default for MavMode {
2688 fn default() -> Self {
2689 Self::DEFAULT
2690 }
2691}
2692bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2693impl MavModeFlag {
2694 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2695}
2696impl Default for MavModeFlag {
2697 fn default() -> Self {
2698 Self::DEFAULT
2699 }
2700}
2701#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2702#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2703#[cfg_attr(feature = "serde", serde(tag = "type"))]
2704#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2705#[repr(u32)]
2706#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2707pub enum MavModeFlagDecodePosition {
2708 #[doc = "First bit: 10000000"]
2709 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2710 #[doc = "Second bit: 01000000"]
2711 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2712 #[doc = "Third bit: 00100000"]
2713 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2714 #[doc = "Fourth bit: 00010000"]
2715 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2716 #[doc = "Fifth bit: 00001000"]
2717 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2718 #[doc = "Sixth bit: 00000100"]
2719 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2720 #[doc = "Seventh bit: 00000010"]
2721 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2722 #[doc = "Eighth bit: 00000001"]
2723 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2724}
2725impl MavModeFlagDecodePosition {
2726 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2727}
2728impl Default for MavModeFlagDecodePosition {
2729 fn default() -> Self {
2730 Self::DEFAULT
2731 }
2732}
2733bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2734impl MavModeProperty {
2735 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2736}
2737impl Default for MavModeProperty {
2738 fn default() -> Self {
2739 Self::DEFAULT
2740 }
2741}
2742#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2743#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2744#[cfg_attr(feature = "serde", serde(tag = "type"))]
2745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2746#[repr(u32)]
2747#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2748#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2749pub enum MavMountMode {
2750 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2751 MAV_MOUNT_MODE_RETRACT = 0,
2752 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2753 MAV_MOUNT_MODE_NEUTRAL = 1,
2754 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2755 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2756 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2757 MAV_MOUNT_MODE_RC_TARGETING = 3,
2758 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2759 MAV_MOUNT_MODE_GPS_POINT = 4,
2760 #[doc = "Gimbal tracks system with specified system ID"]
2761 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2762 #[doc = "Gimbal tracks home position"]
2763 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2764}
2765impl MavMountMode {
2766 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2767}
2768impl Default for MavMountMode {
2769 fn default() -> Self {
2770 Self::DEFAULT
2771 }
2772}
2773#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2775#[cfg_attr(feature = "serde", serde(tag = "type"))]
2776#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2777#[repr(u32)]
2778pub enum MavOdidArmStatus {
2779 #[doc = "Passing arming checks."]
2780 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2781 #[doc = "Generic arming failure, see error string for details."]
2782 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2783}
2784impl MavOdidArmStatus {
2785 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2786}
2787impl Default for MavOdidArmStatus {
2788 fn default() -> Self {
2789 Self::DEFAULT
2790 }
2791}
2792#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2794#[cfg_attr(feature = "serde", serde(tag = "type"))]
2795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2796#[repr(u32)]
2797pub enum MavOdidAuthType {
2798 #[doc = "No authentication type is specified."]
2799 MAV_ODID_AUTH_TYPE_NONE = 0,
2800 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2801 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2802 #[doc = "Signature for the Operator ID."]
2803 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2804 #[doc = "Signature for the entire message set."]
2805 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2806 #[doc = "Authentication is provided by Network Remote ID."]
2807 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2808 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2809 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2810}
2811impl MavOdidAuthType {
2812 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2813}
2814impl Default for MavOdidAuthType {
2815 fn default() -> Self {
2816 Self::DEFAULT
2817 }
2818}
2819#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2821#[cfg_attr(feature = "serde", serde(tag = "type"))]
2822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2823#[repr(u32)]
2824pub enum MavOdidCategoryEu {
2825 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2826 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2827 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2828 MAV_ODID_CATEGORY_EU_OPEN = 1,
2829 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2830 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2831 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2832 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2833}
2834impl MavOdidCategoryEu {
2835 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2836}
2837impl Default for MavOdidCategoryEu {
2838 fn default() -> Self {
2839 Self::DEFAULT
2840 }
2841}
2842#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2844#[cfg_attr(feature = "serde", serde(tag = "type"))]
2845#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2846#[repr(u32)]
2847pub enum MavOdidClassEu {
2848 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2849 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2850 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2851 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2852 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2853 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2854 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2855 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2856 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2857 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2858 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2859 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2860 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2861 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2862 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2863 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2864}
2865impl MavOdidClassEu {
2866 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2867}
2868impl Default for MavOdidClassEu {
2869 fn default() -> Self {
2870 Self::DEFAULT
2871 }
2872}
2873#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2874#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2875#[cfg_attr(feature = "serde", serde(tag = "type"))]
2876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2877#[repr(u32)]
2878pub enum MavOdidClassificationType {
2879 #[doc = "The classification type for the UA is undeclared."]
2880 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2881 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2882 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2883}
2884impl MavOdidClassificationType {
2885 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2886}
2887impl Default for MavOdidClassificationType {
2888 fn default() -> Self {
2889 Self::DEFAULT
2890 }
2891}
2892#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2894#[cfg_attr(feature = "serde", serde(tag = "type"))]
2895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2896#[repr(u32)]
2897pub enum MavOdidDescType {
2898 #[doc = "Optional free-form text description of the purpose of the flight."]
2899 MAV_ODID_DESC_TYPE_TEXT = 0,
2900 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2901 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2902 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2903 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2904}
2905impl MavOdidDescType {
2906 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2907}
2908impl Default for MavOdidDescType {
2909 fn default() -> Self {
2910 Self::DEFAULT
2911 }
2912}
2913#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2915#[cfg_attr(feature = "serde", serde(tag = "type"))]
2916#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2917#[repr(u32)]
2918pub enum MavOdidHeightRef {
2919 #[doc = "The height field is relative to the take-off location."]
2920 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2921 #[doc = "The height field is relative to ground."]
2922 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2923}
2924impl MavOdidHeightRef {
2925 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2926}
2927impl Default for MavOdidHeightRef {
2928 fn default() -> Self {
2929 Self::DEFAULT
2930 }
2931}
2932#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2933#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2934#[cfg_attr(feature = "serde", serde(tag = "type"))]
2935#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2936#[repr(u32)]
2937pub enum MavOdidHorAcc {
2938 #[doc = "The horizontal accuracy is unknown."]
2939 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2940 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2941 MAV_ODID_HOR_ACC_10NM = 1,
2942 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2943 MAV_ODID_HOR_ACC_4NM = 2,
2944 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2945 MAV_ODID_HOR_ACC_2NM = 3,
2946 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2947 MAV_ODID_HOR_ACC_1NM = 4,
2948 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2949 MAV_ODID_HOR_ACC_0_5NM = 5,
2950 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2951 MAV_ODID_HOR_ACC_0_3NM = 6,
2952 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2953 MAV_ODID_HOR_ACC_0_1NM = 7,
2954 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2955 MAV_ODID_HOR_ACC_0_05NM = 8,
2956 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2957 MAV_ODID_HOR_ACC_30_METER = 9,
2958 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2959 MAV_ODID_HOR_ACC_10_METER = 10,
2960 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2961 MAV_ODID_HOR_ACC_3_METER = 11,
2962 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2963 MAV_ODID_HOR_ACC_1_METER = 12,
2964}
2965impl MavOdidHorAcc {
2966 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2967}
2968impl Default for MavOdidHorAcc {
2969 fn default() -> Self {
2970 Self::DEFAULT
2971 }
2972}
2973#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2974#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2975#[cfg_attr(feature = "serde", serde(tag = "type"))]
2976#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2977#[repr(u32)]
2978pub enum MavOdidIdType {
2979 #[doc = "No type defined."]
2980 MAV_ODID_ID_TYPE_NONE = 0,
2981 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2982 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2983 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2984 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2985 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2986 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2987 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2988 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2989}
2990impl MavOdidIdType {
2991 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2992}
2993impl Default for MavOdidIdType {
2994 fn default() -> Self {
2995 Self::DEFAULT
2996 }
2997}
2998#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2999#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3000#[cfg_attr(feature = "serde", serde(tag = "type"))]
3001#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3002#[repr(u32)]
3003pub enum MavOdidOperatorIdType {
3004 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
3005 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
3006}
3007impl MavOdidOperatorIdType {
3008 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3009}
3010impl Default for MavOdidOperatorIdType {
3011 fn default() -> Self {
3012 Self::DEFAULT
3013 }
3014}
3015#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3016#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3017#[cfg_attr(feature = "serde", serde(tag = "type"))]
3018#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3019#[repr(u32)]
3020pub enum MavOdidOperatorLocationType {
3021 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3022 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3023 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3024 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3025 #[doc = "The location/altitude of the operator are fixed values."]
3026 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3027}
3028impl MavOdidOperatorLocationType {
3029 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3030}
3031impl Default for MavOdidOperatorLocationType {
3032 fn default() -> Self {
3033 Self::DEFAULT
3034 }
3035}
3036#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3038#[cfg_attr(feature = "serde", serde(tag = "type"))]
3039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3040#[repr(u32)]
3041pub enum MavOdidSpeedAcc {
3042 #[doc = "The speed accuracy is unknown."]
3043 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3044 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3045 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3046 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3047 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3048 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3049 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3050 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3051 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3052}
3053impl MavOdidSpeedAcc {
3054 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3055}
3056impl Default for MavOdidSpeedAcc {
3057 fn default() -> Self {
3058 Self::DEFAULT
3059 }
3060}
3061#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3062#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3063#[cfg_attr(feature = "serde", serde(tag = "type"))]
3064#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3065#[repr(u32)]
3066pub enum MavOdidStatus {
3067 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3068 MAV_ODID_STATUS_UNDECLARED = 0,
3069 #[doc = "The UA is on the ground."]
3070 MAV_ODID_STATUS_GROUND = 1,
3071 #[doc = "The UA is in the air."]
3072 MAV_ODID_STATUS_AIRBORNE = 2,
3073 #[doc = "The UA is having an emergency."]
3074 MAV_ODID_STATUS_EMERGENCY = 3,
3075 #[doc = "The remote ID system is failing or unreliable in some way."]
3076 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3077}
3078impl MavOdidStatus {
3079 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3080}
3081impl Default for MavOdidStatus {
3082 fn default() -> Self {
3083 Self::DEFAULT
3084 }
3085}
3086#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3088#[cfg_attr(feature = "serde", serde(tag = "type"))]
3089#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3090#[repr(u32)]
3091pub enum MavOdidTimeAcc {
3092 #[doc = "The timestamp accuracy is unknown."]
3093 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3094 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3095 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3096 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3097 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3098 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3099 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3100 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3101 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3102 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3103 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3104 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3105 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3106 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3107 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3108 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3109 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3110 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3111 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3112 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3113 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3114 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3115 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3116 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3117 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3118 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3119 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3120 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3121 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3122 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3123 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3124}
3125impl MavOdidTimeAcc {
3126 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3127}
3128impl Default for MavOdidTimeAcc {
3129 fn default() -> Self {
3130 Self::DEFAULT
3131 }
3132}
3133#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3134#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3135#[cfg_attr(feature = "serde", serde(tag = "type"))]
3136#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3137#[repr(u32)]
3138pub enum MavOdidUaType {
3139 #[doc = "No UA (Unmanned Aircraft) type defined."]
3140 MAV_ODID_UA_TYPE_NONE = 0,
3141 #[doc = "Aeroplane/Airplane. Fixed wing."]
3142 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3143 #[doc = "Helicopter or multirotor."]
3144 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3145 #[doc = "Gyroplane."]
3146 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3147 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3148 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3149 #[doc = "Ornithopter."]
3150 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3151 #[doc = "Glider."]
3152 MAV_ODID_UA_TYPE_GLIDER = 6,
3153 #[doc = "Kite."]
3154 MAV_ODID_UA_TYPE_KITE = 7,
3155 #[doc = "Free Balloon."]
3156 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3157 #[doc = "Captive Balloon."]
3158 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3159 #[doc = "Airship. E.g. a blimp."]
3160 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3161 #[doc = "Free Fall/Parachute (unpowered)."]
3162 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3163 #[doc = "Rocket."]
3164 MAV_ODID_UA_TYPE_ROCKET = 12,
3165 #[doc = "Tethered powered aircraft."]
3166 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3167 #[doc = "Ground Obstacle."]
3168 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3169 #[doc = "Other type of aircraft not listed earlier."]
3170 MAV_ODID_UA_TYPE_OTHER = 15,
3171}
3172impl MavOdidUaType {
3173 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3174}
3175impl Default for MavOdidUaType {
3176 fn default() -> Self {
3177 Self::DEFAULT
3178 }
3179}
3180#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3182#[cfg_attr(feature = "serde", serde(tag = "type"))]
3183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3184#[repr(u32)]
3185pub enum MavOdidVerAcc {
3186 #[doc = "The vertical accuracy is unknown."]
3187 MAV_ODID_VER_ACC_UNKNOWN = 0,
3188 #[doc = "The vertical accuracy is smaller than 150 meter."]
3189 MAV_ODID_VER_ACC_150_METER = 1,
3190 #[doc = "The vertical accuracy is smaller than 45 meter."]
3191 MAV_ODID_VER_ACC_45_METER = 2,
3192 #[doc = "The vertical accuracy is smaller than 25 meter."]
3193 MAV_ODID_VER_ACC_25_METER = 3,
3194 #[doc = "The vertical accuracy is smaller than 10 meter."]
3195 MAV_ODID_VER_ACC_10_METER = 4,
3196 #[doc = "The vertical accuracy is smaller than 3 meter."]
3197 MAV_ODID_VER_ACC_3_METER = 5,
3198 #[doc = "The vertical accuracy is smaller than 1 meter."]
3199 MAV_ODID_VER_ACC_1_METER = 6,
3200}
3201impl MavOdidVerAcc {
3202 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3203}
3204impl Default for MavOdidVerAcc {
3205 fn default() -> Self {
3206 Self::DEFAULT
3207 }
3208}
3209#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3211#[cfg_attr(feature = "serde", serde(tag = "type"))]
3212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3213#[repr(u32)]
3214#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3215pub enum MavParamExtType {
3216 #[doc = "8-bit unsigned integer"]
3217 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3218 #[doc = "8-bit signed integer"]
3219 MAV_PARAM_EXT_TYPE_INT8 = 2,
3220 #[doc = "16-bit unsigned integer"]
3221 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3222 #[doc = "16-bit signed integer"]
3223 MAV_PARAM_EXT_TYPE_INT16 = 4,
3224 #[doc = "32-bit unsigned integer"]
3225 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3226 #[doc = "32-bit signed integer"]
3227 MAV_PARAM_EXT_TYPE_INT32 = 6,
3228 #[doc = "64-bit unsigned integer"]
3229 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3230 #[doc = "64-bit signed integer"]
3231 MAV_PARAM_EXT_TYPE_INT64 = 8,
3232 #[doc = "32-bit floating-point"]
3233 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3234 #[doc = "64-bit floating-point"]
3235 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3236 #[doc = "Custom Type"]
3237 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3238}
3239impl MavParamExtType {
3240 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3241}
3242impl Default for MavParamExtType {
3243 fn default() -> Self {
3244 Self::DEFAULT
3245 }
3246}
3247#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3248#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3249#[cfg_attr(feature = "serde", serde(tag = "type"))]
3250#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3251#[repr(u32)]
3252#[doc = "Specifies the datatype of a MAVLink parameter."]
3253pub enum MavParamType {
3254 #[doc = "8-bit unsigned integer"]
3255 MAV_PARAM_TYPE_UINT8 = 1,
3256 #[doc = "8-bit signed integer"]
3257 MAV_PARAM_TYPE_INT8 = 2,
3258 #[doc = "16-bit unsigned integer"]
3259 MAV_PARAM_TYPE_UINT16 = 3,
3260 #[doc = "16-bit signed integer"]
3261 MAV_PARAM_TYPE_INT16 = 4,
3262 #[doc = "32-bit unsigned integer"]
3263 MAV_PARAM_TYPE_UINT32 = 5,
3264 #[doc = "32-bit signed integer"]
3265 MAV_PARAM_TYPE_INT32 = 6,
3266 #[doc = "64-bit unsigned integer"]
3267 MAV_PARAM_TYPE_UINT64 = 7,
3268 #[doc = "64-bit signed integer"]
3269 MAV_PARAM_TYPE_INT64 = 8,
3270 #[doc = "32-bit floating-point"]
3271 MAV_PARAM_TYPE_REAL32 = 9,
3272 #[doc = "64-bit floating-point"]
3273 MAV_PARAM_TYPE_REAL64 = 10,
3274}
3275impl MavParamType {
3276 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3277}
3278impl Default for MavParamType {
3279 fn default() -> Self {
3280 Self::DEFAULT
3281 }
3282}
3283bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3284impl MavPowerStatus {
3285 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3286}
3287impl Default for MavPowerStatus {
3288 fn default() -> Self {
3289 Self::DEFAULT
3290 }
3291}
3292bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3293impl MavProtocolCapability {
3294 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3295}
3296impl Default for MavProtocolCapability {
3297 fn default() -> Self {
3298 Self::DEFAULT
3299 }
3300}
3301#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3303#[cfg_attr(feature = "serde", serde(tag = "type"))]
3304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3305#[repr(u32)]
3306#[doc = "Result from a MAVLink command (MAV_CMD)"]
3307pub enum MavResult {
3308 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3309 MAV_RESULT_ACCEPTED = 0,
3310 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3311 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3312 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3313 MAV_RESULT_DENIED = 2,
3314 #[doc = "Command is not supported (unknown)."]
3315 MAV_RESULT_UNSUPPORTED = 3,
3316 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3317 MAV_RESULT_FAILED = 4,
3318 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3319 MAV_RESULT_IN_PROGRESS = 5,
3320 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3321 MAV_RESULT_CANCELLED = 6,
3322 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3323 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3324 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3325 MAV_RESULT_COMMAND_INT_ONLY = 8,
3326 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3327 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3328}
3329impl MavResult {
3330 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3331}
3332impl Default for MavResult {
3333 fn default() -> Self {
3334 Self::DEFAULT
3335 }
3336}
3337#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3339#[cfg_attr(feature = "serde", serde(tag = "type"))]
3340#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3341#[repr(u32)]
3342#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3343#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3344pub enum MavRoi {
3345 #[doc = "No region of interest."]
3346 MAV_ROI_NONE = 0,
3347 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3348 MAV_ROI_WPNEXT = 1,
3349 #[doc = "Point toward given waypoint."]
3350 MAV_ROI_WPINDEX = 2,
3351 #[doc = "Point toward fixed location."]
3352 MAV_ROI_LOCATION = 3,
3353 #[doc = "Point toward of given id."]
3354 MAV_ROI_TARGET = 4,
3355}
3356impl MavRoi {
3357 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3358}
3359impl Default for MavRoi {
3360 fn default() -> Self {
3361 Self::DEFAULT
3362 }
3363}
3364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3366#[cfg_attr(feature = "serde", serde(tag = "type"))]
3367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3368#[repr(u32)]
3369#[doc = "Enumeration of sensor orientation, according to its rotations"]
3370pub enum MavSensorOrientation {
3371 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3372 MAV_SENSOR_ROTATION_NONE = 0,
3373 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3374 MAV_SENSOR_ROTATION_YAW_45 = 1,
3375 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3376 MAV_SENSOR_ROTATION_YAW_90 = 2,
3377 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3378 MAV_SENSOR_ROTATION_YAW_135 = 3,
3379 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3380 MAV_SENSOR_ROTATION_YAW_180 = 4,
3381 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3382 MAV_SENSOR_ROTATION_YAW_225 = 5,
3383 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3384 MAV_SENSOR_ROTATION_YAW_270 = 6,
3385 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3386 MAV_SENSOR_ROTATION_YAW_315 = 7,
3387 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3388 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3389 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3390 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3391 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3392 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3393 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3394 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3395 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3396 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3397 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3398 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3399 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3400 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3401 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3402 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3403 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3404 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3405 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3406 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3407 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3408 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3409 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3410 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3411 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3412 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3413 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3414 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3415 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3416 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3417 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3418 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3419 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3420 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3421 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3422 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3423 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3424 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3425 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3426 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3427 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3428 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3429 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3430 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3431 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3432 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3433 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3434 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3435 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3436 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3437 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3438 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3439 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3440 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3441 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3442 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3443 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3444 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3445 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3446 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3447 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3448 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3449 #[doc = "Pitch: 315"]
3450 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3451 #[doc = "Roll: 90, Pitch: 315"]
3452 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3453 #[doc = "Custom orientation"]
3454 MAV_SENSOR_ROTATION_CUSTOM = 100,
3455}
3456impl MavSensorOrientation {
3457 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3458}
3459impl Default for MavSensorOrientation {
3460 fn default() -> Self {
3461 Self::DEFAULT
3462 }
3463}
3464#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3466#[cfg_attr(feature = "serde", serde(tag = "type"))]
3467#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3468#[repr(u32)]
3469#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3470pub enum MavSeverity {
3471 #[doc = "System is unusable. This is a \"panic\" condition."]
3472 MAV_SEVERITY_EMERGENCY = 0,
3473 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3474 MAV_SEVERITY_ALERT = 1,
3475 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3476 MAV_SEVERITY_CRITICAL = 2,
3477 #[doc = "Indicates an error in secondary/redundant systems."]
3478 MAV_SEVERITY_ERROR = 3,
3479 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3480 MAV_SEVERITY_WARNING = 4,
3481 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3482 MAV_SEVERITY_NOTICE = 5,
3483 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3484 MAV_SEVERITY_INFO = 6,
3485 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3486 MAV_SEVERITY_DEBUG = 7,
3487}
3488impl MavSeverity {
3489 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3490}
3491impl Default for MavSeverity {
3492 fn default() -> Self {
3493 Self::DEFAULT
3494 }
3495}
3496#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3498#[cfg_attr(feature = "serde", serde(tag = "type"))]
3499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3500#[repr(u32)]
3501#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3502pub enum MavStandardMode {
3503 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3504 MAV_STANDARD_MODE_NON_STANDARD = 0,
3505 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3506 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3507 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3508 MAV_STANDARD_MODE_ORBIT = 2,
3509 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3510 MAV_STANDARD_MODE_CRUISE = 3,
3511 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3512 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3513 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3514 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3515 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3516 MAV_STANDARD_MODE_MISSION = 6,
3517 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3518 MAV_STANDARD_MODE_LAND = 7,
3519 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3520 MAV_STANDARD_MODE_TAKEOFF = 8,
3521}
3522impl MavStandardMode {
3523 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3524}
3525impl Default for MavStandardMode {
3526 fn default() -> Self {
3527 Self::DEFAULT
3528 }
3529}
3530#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3531#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3532#[cfg_attr(feature = "serde", serde(tag = "type"))]
3533#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3534#[repr(u32)]
3535pub enum MavState {
3536 #[doc = "Uninitialized system, state is unknown."]
3537 MAV_STATE_UNINIT = 0,
3538 #[doc = "System is booting up."]
3539 MAV_STATE_BOOT = 1,
3540 #[doc = "System is calibrating and not flight-ready."]
3541 MAV_STATE_CALIBRATING = 2,
3542 #[doc = "System is grounded and on standby. It can be launched any time."]
3543 MAV_STATE_STANDBY = 3,
3544 #[doc = "System is active and might be already airborne. Motors are engaged."]
3545 MAV_STATE_ACTIVE = 4,
3546 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3547 MAV_STATE_CRITICAL = 5,
3548 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3549 MAV_STATE_EMERGENCY = 6,
3550 #[doc = "System just initialized its power-down sequence, will shut down now."]
3551 MAV_STATE_POWEROFF = 7,
3552 #[doc = "System is terminating itself (failsafe or commanded)."]
3553 MAV_STATE_FLIGHT_TERMINATION = 8,
3554}
3555impl MavState {
3556 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3557}
3558impl Default for MavState {
3559 fn default() -> Self {
3560 Self::DEFAULT
3561 }
3562}
3563bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3564impl MavSysStatusSensor {
3565 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3566}
3567impl Default for MavSysStatusSensor {
3568 fn default() -> Self {
3569 Self::DEFAULT
3570 }
3571}
3572bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3573impl MavSysStatusSensorExtended {
3574 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3575}
3576impl Default for MavSysStatusSensorExtended {
3577 fn default() -> Self {
3578 Self::DEFAULT
3579 }
3580}
3581#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3582#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3583#[cfg_attr(feature = "serde", serde(tag = "type"))]
3584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3585#[repr(u32)]
3586pub enum MavTunnelPayloadType {
3587 #[doc = "Encoding of payload unknown."]
3588 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3589 #[doc = "Registered for STorM32 gimbal controller."]
3590 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3591 #[doc = "Registered for STorM32 gimbal controller."]
3592 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3593 #[doc = "Registered for STorM32 gimbal controller."]
3594 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3595 #[doc = "Registered for STorM32 gimbal controller."]
3596 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3597 #[doc = "Registered for STorM32 gimbal controller."]
3598 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3599 #[doc = "Registered for STorM32 gimbal controller."]
3600 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3601 #[doc = "Registered for STorM32 gimbal controller."]
3602 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3603 #[doc = "Registered for STorM32 gimbal controller."]
3604 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3605 #[doc = "Registered for STorM32 gimbal controller."]
3606 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3607 #[doc = "Registered for STorM32 gimbal controller."]
3608 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3609 #[doc = "Registered for ModalAI remote OSD protocol."]
3610 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3611 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3612 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3613 #[doc = "Registered for ModalAI vendor use."]
3614 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3615}
3616impl MavTunnelPayloadType {
3617 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3618}
3619impl Default for MavTunnelPayloadType {
3620 fn default() -> Self {
3621 Self::DEFAULT
3622 }
3623}
3624#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3625#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3626#[cfg_attr(feature = "serde", serde(tag = "type"))]
3627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3628#[repr(u32)]
3629#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3630pub enum MavType {
3631 #[doc = "Generic micro air vehicle"]
3632 MAV_TYPE_GENERIC = 0,
3633 #[doc = "Fixed wing aircraft."]
3634 MAV_TYPE_FIXED_WING = 1,
3635 #[doc = "Quadrotor"]
3636 MAV_TYPE_QUADROTOR = 2,
3637 #[doc = "Coaxial helicopter"]
3638 MAV_TYPE_COAXIAL = 3,
3639 #[doc = "Normal helicopter with tail rotor."]
3640 MAV_TYPE_HELICOPTER = 4,
3641 #[doc = "Ground installation"]
3642 MAV_TYPE_ANTENNA_TRACKER = 5,
3643 #[doc = "Operator control unit / ground control station"]
3644 MAV_TYPE_GCS = 6,
3645 #[doc = "Airship, controlled"]
3646 MAV_TYPE_AIRSHIP = 7,
3647 #[doc = "Free balloon, uncontrolled"]
3648 MAV_TYPE_FREE_BALLOON = 8,
3649 #[doc = "Rocket"]
3650 MAV_TYPE_ROCKET = 9,
3651 #[doc = "Ground rover"]
3652 MAV_TYPE_GROUND_ROVER = 10,
3653 #[doc = "Surface vessel, boat, ship"]
3654 MAV_TYPE_SURFACE_BOAT = 11,
3655 #[doc = "Submarine"]
3656 MAV_TYPE_SUBMARINE = 12,
3657 #[doc = "Hexarotor"]
3658 MAV_TYPE_HEXAROTOR = 13,
3659 #[doc = "Octorotor"]
3660 MAV_TYPE_OCTOROTOR = 14,
3661 #[doc = "Tricopter"]
3662 MAV_TYPE_TRICOPTER = 15,
3663 #[doc = "Flapping wing"]
3664 MAV_TYPE_FLAPPING_WING = 16,
3665 #[doc = "Kite"]
3666 MAV_TYPE_KITE = 17,
3667 #[doc = "Onboard companion controller"]
3668 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3669 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3670 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3671 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3672 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3673 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3674 MAV_TYPE_VTOL_TILTROTOR = 21,
3675 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3676 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3677 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3678 MAV_TYPE_VTOL_TAILSITTER = 23,
3679 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3680 MAV_TYPE_VTOL_TILTWING = 24,
3681 #[doc = "VTOL reserved 5"]
3682 MAV_TYPE_VTOL_RESERVED5 = 25,
3683 #[doc = "Gimbal"]
3684 MAV_TYPE_GIMBAL = 26,
3685 #[doc = "ADSB system"]
3686 MAV_TYPE_ADSB = 27,
3687 #[doc = "Steerable, nonrigid airfoil"]
3688 MAV_TYPE_PARAFOIL = 28,
3689 #[doc = "Dodecarotor"]
3690 MAV_TYPE_DODECAROTOR = 29,
3691 #[doc = "Camera"]
3692 MAV_TYPE_CAMERA = 30,
3693 #[doc = "Charging station"]
3694 MAV_TYPE_CHARGING_STATION = 31,
3695 #[doc = "FLARM collision avoidance system"]
3696 MAV_TYPE_FLARM = 32,
3697 #[doc = "Servo"]
3698 MAV_TYPE_SERVO = 33,
3699 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3700 MAV_TYPE_ODID = 34,
3701 #[doc = "Decarotor"]
3702 MAV_TYPE_DECAROTOR = 35,
3703 #[doc = "Battery"]
3704 MAV_TYPE_BATTERY = 36,
3705 #[doc = "Parachute"]
3706 MAV_TYPE_PARACHUTE = 37,
3707 #[doc = "Log"]
3708 MAV_TYPE_LOG = 38,
3709 #[doc = "OSD"]
3710 MAV_TYPE_OSD = 39,
3711 #[doc = "IMU"]
3712 MAV_TYPE_IMU = 40,
3713 #[doc = "GPS"]
3714 MAV_TYPE_GPS = 41,
3715 #[doc = "Winch"]
3716 MAV_TYPE_WINCH = 42,
3717 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3718 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3719 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3720 MAV_TYPE_ILLUMINATOR = 44,
3721 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3722 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3723}
3724impl MavType {
3725 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3726}
3727impl Default for MavType {
3728 fn default() -> Self {
3729 Self::DEFAULT
3730 }
3731}
3732#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3733#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3734#[cfg_attr(feature = "serde", serde(tag = "type"))]
3735#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3736#[repr(u32)]
3737#[doc = "Enumeration of VTOL states"]
3738pub enum MavVtolState {
3739 #[doc = "MAV is not configured as VTOL"]
3740 MAV_VTOL_STATE_UNDEFINED = 0,
3741 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3742 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3743 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3744 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3745 #[doc = "VTOL is in multicopter state"]
3746 MAV_VTOL_STATE_MC = 3,
3747 #[doc = "VTOL is in fixed-wing state"]
3748 MAV_VTOL_STATE_FW = 4,
3749}
3750impl MavVtolState {
3751 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3752}
3753impl Default for MavVtolState {
3754 fn default() -> Self {
3755 Self::DEFAULT
3756 }
3757}
3758bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3759impl MavWinchStatusFlag {
3760 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3761}
3762impl Default for MavWinchStatusFlag {
3763 fn default() -> Self {
3764 Self::DEFAULT
3765 }
3766}
3767#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3769#[cfg_attr(feature = "serde", serde(tag = "type"))]
3770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3771#[repr(u32)]
3772pub enum MavlinkDataStreamType {
3773 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3774 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3775 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3776 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3777 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3778 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3779}
3780impl MavlinkDataStreamType {
3781 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3782}
3783impl Default for MavlinkDataStreamType {
3784 fn default() -> Self {
3785 Self::DEFAULT
3786 }
3787}
3788#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3789#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3790#[cfg_attr(feature = "serde", serde(tag = "type"))]
3791#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3792#[repr(u32)]
3793#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3794pub enum MissionState {
3795 #[doc = "The mission status reporting is not supported."]
3796 MISSION_STATE_UNKNOWN = 0,
3797 #[doc = "No mission on the vehicle."]
3798 MISSION_STATE_NO_MISSION = 1,
3799 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3800 MISSION_STATE_NOT_STARTED = 2,
3801 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3802 MISSION_STATE_ACTIVE = 3,
3803 #[doc = "Mission is paused when in auto mode."]
3804 MISSION_STATE_PAUSED = 4,
3805 #[doc = "Mission has executed all mission items."]
3806 MISSION_STATE_COMPLETE = 5,
3807}
3808impl MissionState {
3809 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3810}
3811impl Default for MissionState {
3812 fn default() -> Self {
3813 Self::DEFAULT
3814 }
3815}
3816#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3817#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3818#[cfg_attr(feature = "serde", serde(tag = "type"))]
3819#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3820#[repr(u32)]
3821#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3822pub enum MotorTestOrder {
3823 #[doc = "Default autopilot motor test method."]
3824 MOTOR_TEST_ORDER_DEFAULT = 0,
3825 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3826 MOTOR_TEST_ORDER_SEQUENCE = 1,
3827 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3828 MOTOR_TEST_ORDER_BOARD = 2,
3829}
3830impl MotorTestOrder {
3831 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3832}
3833impl Default for MotorTestOrder {
3834 fn default() -> Self {
3835 Self::DEFAULT
3836 }
3837}
3838#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3840#[cfg_attr(feature = "serde", serde(tag = "type"))]
3841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3842#[repr(u32)]
3843#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3844pub enum MotorTestThrottleType {
3845 #[doc = "Throttle as a percentage (0 ~ 100)"]
3846 MOTOR_TEST_THROTTLE_PERCENT = 0,
3847 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3848 MOTOR_TEST_THROTTLE_PWM = 1,
3849 #[doc = "Throttle pass-through from pilot's transmitter."]
3850 MOTOR_TEST_THROTTLE_PILOT = 2,
3851 #[doc = "Per-motor compass calibration test."]
3852 MOTOR_TEST_COMPASS_CAL = 3,
3853}
3854impl MotorTestThrottleType {
3855 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3856}
3857impl Default for MotorTestThrottleType {
3858 fn default() -> Self {
3859 Self::DEFAULT
3860 }
3861}
3862#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3863#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3864#[cfg_attr(feature = "serde", serde(tag = "type"))]
3865#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3866#[repr(u32)]
3867pub enum NavVtolLandOptions {
3868 #[doc = "Default autopilot landing behaviour."]
3869 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3870 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3871 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3872 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3873 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3874}
3875impl NavVtolLandOptions {
3876 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3877}
3878impl Default for NavVtolLandOptions {
3879 fn default() -> Self {
3880 Self::DEFAULT
3881 }
3882}
3883#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3884#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3885#[cfg_attr(feature = "serde", serde(tag = "type"))]
3886#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3887#[repr(u32)]
3888#[doc = "Yaw behaviour during orbit flight."]
3889pub enum OrbitYawBehaviour {
3890 #[doc = "Vehicle front points to the center (default)."]
3891 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3892 #[doc = "Vehicle front holds heading when message received."]
3893 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3894 #[doc = "Yaw uncontrolled."]
3895 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3896 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3897 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3898 #[doc = "Yaw controlled by RC input."]
3899 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3900 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3901 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3902}
3903impl OrbitYawBehaviour {
3904 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3905}
3906impl Default for OrbitYawBehaviour {
3907 fn default() -> Self {
3908 Self::DEFAULT
3909 }
3910}
3911#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3913#[cfg_attr(feature = "serde", serde(tag = "type"))]
3914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3915#[repr(u32)]
3916#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3917pub enum ParachuteAction {
3918 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3919 PARACHUTE_DISABLE = 0,
3920 #[doc = "Enable auto-release of parachute."]
3921 PARACHUTE_ENABLE = 1,
3922 #[doc = "Release parachute and kill motors."]
3923 PARACHUTE_RELEASE = 2,
3924}
3925impl ParachuteAction {
3926 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3927}
3928impl Default for ParachuteAction {
3929 fn default() -> Self {
3930 Self::DEFAULT
3931 }
3932}
3933#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3934#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3935#[cfg_attr(feature = "serde", serde(tag = "type"))]
3936#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3937#[repr(u32)]
3938#[doc = "Result from PARAM_EXT_SET message."]
3939pub enum ParamAck {
3940 #[doc = "Parameter value ACCEPTED and SET"]
3941 PARAM_ACK_ACCEPTED = 0,
3942 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3943 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3944 #[doc = "Parameter failed to set"]
3945 PARAM_ACK_FAILED = 2,
3946 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3947 PARAM_ACK_IN_PROGRESS = 3,
3948}
3949impl ParamAck {
3950 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3951}
3952impl Default for ParamAck {
3953 fn default() -> Self {
3954 Self::DEFAULT
3955 }
3956}
3957bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3958impl PositionTargetTypemask {
3959 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3960}
3961impl Default for PositionTargetTypemask {
3962 fn default() -> Self {
3963 Self::DEFAULT
3964 }
3965}
3966#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3967#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3968#[cfg_attr(feature = "serde", serde(tag = "type"))]
3969#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3970#[repr(u32)]
3971#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3972pub enum PrecisionLandMode {
3973 #[doc = "Normal (non-precision) landing."]
3974 PRECISION_LAND_MODE_DISABLED = 0,
3975 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3976 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3977 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3978 PRECISION_LAND_MODE_REQUIRED = 2,
3979}
3980impl PrecisionLandMode {
3981 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3982}
3983impl Default for PrecisionLandMode {
3984 fn default() -> Self {
3985 Self::DEFAULT
3986 }
3987}
3988#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3989#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3990#[cfg_attr(feature = "serde", serde(tag = "type"))]
3991#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3992#[repr(u32)]
3993#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3994pub enum PreflightStorageMissionAction {
3995 #[doc = "Read current mission data from persistent storage"]
3996 MISSION_READ_PERSISTENT = 0,
3997 #[doc = "Write current mission data to persistent storage"]
3998 MISSION_WRITE_PERSISTENT = 1,
3999 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4000 MISSION_RESET_DEFAULT = 2,
4001}
4002impl PreflightStorageMissionAction {
4003 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4004}
4005impl Default for PreflightStorageMissionAction {
4006 fn default() -> Self {
4007 Self::DEFAULT
4008 }
4009}
4010#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4012#[cfg_attr(feature = "serde", serde(tag = "type"))]
4013#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4014#[repr(u32)]
4015#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4016pub enum PreflightStorageParameterAction {
4017 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4018 PARAM_READ_PERSISTENT = 0,
4019 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4020 PARAM_WRITE_PERSISTENT = 1,
4021 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4022 PARAM_RESET_CONFIG_DEFAULT = 2,
4023 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4024 PARAM_RESET_SENSOR_DEFAULT = 3,
4025 #[doc = "Reset all parameters, including operation counters, to default values"]
4026 PARAM_RESET_ALL_DEFAULT = 4,
4027}
4028impl PreflightStorageParameterAction {
4029 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4030}
4031impl Default for PreflightStorageParameterAction {
4032 fn default() -> Self {
4033 Self::DEFAULT
4034 }
4035}
4036bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "RADIO_RC_CHANNELS flags (bitmask)."] pub struct RadioRcChannelsFlags : u16 { # [doc = "Failsafe is active. The content of the RC channels data in the RADIO_RC_CHANNELS message is implementation dependent."] const RADIO_RC_CHANNELS_FLAGS_FAILSAFE = 1 ; # [doc = "Channel data may be out of date. This is set when the receiver is unable to validate incoming data from the transmitter and has therefore resent the last valid data it received."] const RADIO_RC_CHANNELS_FLAGS_OUTDATED = 2 ; } }
4037impl RadioRcChannelsFlags {
4038 pub const DEFAULT: Self = Self::RADIO_RC_CHANNELS_FLAGS_FAILSAFE;
4039}
4040impl Default for RadioRcChannelsFlags {
4041 fn default() -> Self {
4042 Self::DEFAULT
4043 }
4044}
4045#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4046#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4047#[cfg_attr(feature = "serde", serde(tag = "type"))]
4048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4049#[repr(u32)]
4050#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4051pub enum RcSubType {
4052 #[doc = "Spektrum DSM2"]
4053 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4054 #[doc = "Spektrum DSMX"]
4055 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4056 #[doc = "Spektrum DSMX8"]
4057 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4058}
4059impl RcSubType {
4060 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4061}
4062impl Default for RcSubType {
4063 fn default() -> Self {
4064 Self::DEFAULT
4065 }
4066}
4067#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4069#[cfg_attr(feature = "serde", serde(tag = "type"))]
4070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4071#[repr(u32)]
4072#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4073pub enum RcType {
4074 #[doc = "Spektrum"]
4075 RC_TYPE_SPEKTRUM = 0,
4076 #[doc = "CRSF"]
4077 RC_TYPE_CRSF = 1,
4078}
4079impl RcType {
4080 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4081}
4082impl Default for RcType {
4083 fn default() -> Self {
4084 Self::DEFAULT
4085 }
4086}
4087#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4088#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4089#[cfg_attr(feature = "serde", serde(tag = "type"))]
4090#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4091#[repr(u32)]
4092#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4093pub enum RebootShutdownConditions {
4094 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4095 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4096 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4097 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4098}
4099impl RebootShutdownConditions {
4100 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4101}
4102impl Default for RebootShutdownConditions {
4103 fn default() -> Self {
4104 Self::DEFAULT
4105 }
4106}
4107#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4108#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4109#[cfg_attr(feature = "serde", serde(tag = "type"))]
4110#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4111#[repr(u32)]
4112#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4113pub enum RtkBaselineCoordinateSystem {
4114 #[doc = "Earth-centered, Earth-fixed"]
4115 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4116 #[doc = "RTK basestation centered, north, east, down"]
4117 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4118}
4119impl RtkBaselineCoordinateSystem {
4120 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4121}
4122impl Default for RtkBaselineCoordinateSystem {
4123 fn default() -> Self {
4124 Self::DEFAULT
4125 }
4126}
4127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4129#[cfg_attr(feature = "serde", serde(tag = "type"))]
4130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4131#[repr(u32)]
4132#[doc = "Possible safety switch states."]
4133pub enum SafetySwitchState {
4134 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4135 SAFETY_SWITCH_STATE_SAFE = 0,
4136 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4137 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4138}
4139impl SafetySwitchState {
4140 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4141}
4142impl Default for SafetySwitchState {
4143 fn default() -> Self {
4144 Self::DEFAULT
4145 }
4146}
4147#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4148#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4149#[cfg_attr(feature = "serde", serde(tag = "type"))]
4150#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4151#[repr(u32)]
4152#[doc = "SERIAL_CONTROL device types"]
4153pub enum SerialControlDev {
4154 #[doc = "First telemetry port"]
4155 SERIAL_CONTROL_DEV_TELEM1 = 0,
4156 #[doc = "Second telemetry port"]
4157 SERIAL_CONTROL_DEV_TELEM2 = 1,
4158 #[doc = "First GPS port"]
4159 SERIAL_CONTROL_DEV_GPS1 = 2,
4160 #[doc = "Second GPS port"]
4161 SERIAL_CONTROL_DEV_GPS2 = 3,
4162 #[doc = "system shell"]
4163 SERIAL_CONTROL_DEV_SHELL = 10,
4164 #[doc = "SERIAL0"]
4165 SERIAL_CONTROL_SERIAL0 = 100,
4166 #[doc = "SERIAL1"]
4167 SERIAL_CONTROL_SERIAL1 = 101,
4168 #[doc = "SERIAL2"]
4169 SERIAL_CONTROL_SERIAL2 = 102,
4170 #[doc = "SERIAL3"]
4171 SERIAL_CONTROL_SERIAL3 = 103,
4172 #[doc = "SERIAL4"]
4173 SERIAL_CONTROL_SERIAL4 = 104,
4174 #[doc = "SERIAL5"]
4175 SERIAL_CONTROL_SERIAL5 = 105,
4176 #[doc = "SERIAL6"]
4177 SERIAL_CONTROL_SERIAL6 = 106,
4178 #[doc = "SERIAL7"]
4179 SERIAL_CONTROL_SERIAL7 = 107,
4180 #[doc = "SERIAL8"]
4181 SERIAL_CONTROL_SERIAL8 = 108,
4182 #[doc = "SERIAL9"]
4183 SERIAL_CONTROL_SERIAL9 = 109,
4184}
4185impl SerialControlDev {
4186 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4187}
4188impl Default for SerialControlDev {
4189 fn default() -> Self {
4190 Self::DEFAULT
4191 }
4192}
4193bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4194impl SerialControlFlag {
4195 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4196}
4197impl Default for SerialControlFlag {
4198 fn default() -> Self {
4199 Self::DEFAULT
4200 }
4201}
4202#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4204#[cfg_attr(feature = "serde", serde(tag = "type"))]
4205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4206#[repr(u32)]
4207#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4208pub enum SetFocusType {
4209 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4210 FOCUS_TYPE_STEP = 0,
4211 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4212 FOCUS_TYPE_CONTINUOUS = 1,
4213 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4214 FOCUS_TYPE_RANGE = 2,
4215 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4216 FOCUS_TYPE_METERS = 3,
4217 #[doc = "Focus automatically."]
4218 FOCUS_TYPE_AUTO = 4,
4219 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4220 FOCUS_TYPE_AUTO_SINGLE = 5,
4221 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4222 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4223}
4224impl SetFocusType {
4225 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4226}
4227impl Default for SetFocusType {
4228 fn default() -> Self {
4229 Self::DEFAULT
4230 }
4231}
4232#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4234#[cfg_attr(feature = "serde", serde(tag = "type"))]
4235#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4236#[repr(u32)]
4237#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4238pub enum SpeedType {
4239 #[doc = "Airspeed"]
4240 SPEED_TYPE_AIRSPEED = 0,
4241 #[doc = "Groundspeed"]
4242 SPEED_TYPE_GROUNDSPEED = 1,
4243 #[doc = "Climb speed"]
4244 SPEED_TYPE_CLIMB_SPEED = 2,
4245 #[doc = "Descent speed"]
4246 SPEED_TYPE_DESCENT_SPEED = 3,
4247}
4248impl SpeedType {
4249 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4250}
4251impl Default for SpeedType {
4252 fn default() -> Self {
4253 Self::DEFAULT
4254 }
4255}
4256#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4258#[cfg_attr(feature = "serde", serde(tag = "type"))]
4259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4260#[repr(u32)]
4261#[doc = "Flags to indicate the status of camera storage."]
4262pub enum StorageStatus {
4263 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4264 STORAGE_STATUS_EMPTY = 0,
4265 #[doc = "Storage present but unformatted."]
4266 STORAGE_STATUS_UNFORMATTED = 1,
4267 #[doc = "Storage present and ready."]
4268 STORAGE_STATUS_READY = 2,
4269 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4270 STORAGE_STATUS_NOT_SUPPORTED = 3,
4271}
4272impl StorageStatus {
4273 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4274}
4275impl Default for StorageStatus {
4276 fn default() -> Self {
4277 Self::DEFAULT
4278 }
4279}
4280#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4281#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4282#[cfg_attr(feature = "serde", serde(tag = "type"))]
4283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4284#[repr(u32)]
4285#[doc = "Flags to indicate the type of storage."]
4286pub enum StorageType {
4287 #[doc = "Storage type is not known."]
4288 STORAGE_TYPE_UNKNOWN = 0,
4289 #[doc = "Storage type is USB device."]
4290 STORAGE_TYPE_USB_STICK = 1,
4291 #[doc = "Storage type is SD card."]
4292 STORAGE_TYPE_SD = 2,
4293 #[doc = "Storage type is microSD card."]
4294 STORAGE_TYPE_MICROSD = 3,
4295 #[doc = "Storage type is CFast."]
4296 STORAGE_TYPE_CF = 4,
4297 #[doc = "Storage type is CFexpress."]
4298 STORAGE_TYPE_CFE = 5,
4299 #[doc = "Storage type is XQD."]
4300 STORAGE_TYPE_XQD = 6,
4301 #[doc = "Storage type is HD mass storage type."]
4302 STORAGE_TYPE_HD = 7,
4303 #[doc = "Storage type is other, not listed type."]
4304 STORAGE_TYPE_OTHER = 254,
4305}
4306impl StorageType {
4307 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4308}
4309impl Default for StorageType {
4310 fn default() -> Self {
4311 Self::DEFAULT
4312 }
4313}
4314bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4315impl StorageUsageFlag {
4316 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4317}
4318impl Default for StorageUsageFlag {
4319 fn default() -> Self {
4320 Self::DEFAULT
4321 }
4322}
4323bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate the sensor reporting capabilities for TARGET_ABSOLUTE."] pub struct TargetAbsoluteSensorCapabilityFlags : u8 { const TARGET_ABSOLUTE_SENSOR_CAPABILITY_POSITION = 1 ; const TARGET_ABSOLUTE_SENSOR_CAPABILITY_VELOCITY = 2 ; const TARGET_ABSOLUTE_SENSOR_CAPABILITY_ACCELERATION = 4 ; const TARGET_ABSOLUTE_SENSOR_CAPABILITY_ATTITUDE = 8 ; const TARGET_ABSOLUTE_SENSOR_CAPABILITY_RATES = 16 ; } }
4324impl TargetAbsoluteSensorCapabilityFlags {
4325 pub const DEFAULT: Self = Self::TARGET_ABSOLUTE_SENSOR_CAPABILITY_POSITION;
4326}
4327impl Default for TargetAbsoluteSensorCapabilityFlags {
4328 fn default() -> Self {
4329 Self::DEFAULT
4330 }
4331}
4332#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4334#[cfg_attr(feature = "serde", serde(tag = "type"))]
4335#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4336#[repr(u32)]
4337#[doc = "The frame of a target observation from an onboard sensor."]
4338pub enum TargetObsFrame {
4339 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
4340 TARGET_OBS_FRAME_LOCAL_NED = 0,
4341 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
4342 TARGET_OBS_FRAME_BODY_FRD = 1,
4343 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with an origin that travels with vehicle."]
4344 TARGET_OBS_FRAME_LOCAL_OFFSET_NED = 2,
4345 #[doc = "Other sensor frame for target observations neither in local NED nor in body FRD."]
4346 TARGET_OBS_FRAME_OTHER = 3,
4347}
4348impl TargetObsFrame {
4349 pub const DEFAULT: Self = Self::TARGET_OBS_FRAME_LOCAL_NED;
4350}
4351impl Default for TargetObsFrame {
4352 fn default() -> Self {
4353 Self::DEFAULT
4354 }
4355}
4356#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4357#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4358#[cfg_attr(feature = "serde", serde(tag = "type"))]
4359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4360#[repr(u32)]
4361#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4362pub enum TuneFormat {
4363 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4364 TUNE_FORMAT_QBASIC1_1 = 1,
4365 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4366 TUNE_FORMAT_MML_MODERN = 2,
4367}
4368impl TuneFormat {
4369 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4370}
4371impl Default for TuneFormat {
4372 fn default() -> Self {
4373 Self::DEFAULT
4374 }
4375}
4376#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4378#[cfg_attr(feature = "serde", serde(tag = "type"))]
4379#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4380#[repr(u32)]
4381#[doc = "Generalized UAVCAN node health"]
4382pub enum UavcanNodeHealth {
4383 #[doc = "The node is functioning properly."]
4384 UAVCAN_NODE_HEALTH_OK = 0,
4385 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4386 UAVCAN_NODE_HEALTH_WARNING = 1,
4387 #[doc = "The node has encountered a major failure."]
4388 UAVCAN_NODE_HEALTH_ERROR = 2,
4389 #[doc = "The node has suffered a fatal malfunction."]
4390 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4391}
4392impl UavcanNodeHealth {
4393 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4394}
4395impl Default for UavcanNodeHealth {
4396 fn default() -> Self {
4397 Self::DEFAULT
4398 }
4399}
4400#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4401#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4402#[cfg_attr(feature = "serde", serde(tag = "type"))]
4403#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4404#[repr(u32)]
4405#[doc = "Generalized UAVCAN node mode"]
4406pub enum UavcanNodeMode {
4407 #[doc = "The node is performing its primary functions."]
4408 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4409 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4410 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4411 #[doc = "The node is under maintenance."]
4412 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4413 #[doc = "The node is in the process of updating its software."]
4414 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4415 #[doc = "The node is no longer available online."]
4416 UAVCAN_NODE_MODE_OFFLINE = 7,
4417}
4418impl UavcanNodeMode {
4419 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4420}
4421impl Default for UavcanNodeMode {
4422 fn default() -> Self {
4423 Self::DEFAULT
4424 }
4425}
4426bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4427impl UtmDataAvailFlags {
4428 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4429}
4430impl Default for UtmDataAvailFlags {
4431 fn default() -> Self {
4432 Self::DEFAULT
4433 }
4434}
4435#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4436#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4437#[cfg_attr(feature = "serde", serde(tag = "type"))]
4438#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4439#[repr(u32)]
4440#[doc = "Airborne status of UAS."]
4441pub enum UtmFlightState {
4442 #[doc = "The flight state can't be determined."]
4443 UTM_FLIGHT_STATE_UNKNOWN = 1,
4444 #[doc = "UAS on ground."]
4445 UTM_FLIGHT_STATE_GROUND = 2,
4446 #[doc = "UAS airborne."]
4447 UTM_FLIGHT_STATE_AIRBORNE = 3,
4448 #[doc = "UAS is in an emergency flight state."]
4449 UTM_FLIGHT_STATE_EMERGENCY = 16,
4450 #[doc = "UAS has no active controls."]
4451 UTM_FLIGHT_STATE_NOCTRL = 32,
4452}
4453impl UtmFlightState {
4454 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4455}
4456impl Default for UtmFlightState {
4457 fn default() -> Self {
4458 Self::DEFAULT
4459 }
4460}
4461#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4462#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4463#[cfg_attr(feature = "serde", serde(tag = "type"))]
4464#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4465#[repr(u32)]
4466#[doc = "Video stream encodings"]
4467pub enum VideoStreamEncoding {
4468 #[doc = "Stream encoding is unknown"]
4469 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4470 #[doc = "Stream encoding is H.264"]
4471 VIDEO_STREAM_ENCODING_H264 = 1,
4472 #[doc = "Stream encoding is H.265"]
4473 VIDEO_STREAM_ENCODING_H265 = 2,
4474}
4475impl VideoStreamEncoding {
4476 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4477}
4478impl Default for VideoStreamEncoding {
4479 fn default() -> Self {
4480 Self::DEFAULT
4481 }
4482}
4483bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4484impl VideoStreamStatusFlags {
4485 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4486}
4487impl Default for VideoStreamStatusFlags {
4488 fn default() -> Self {
4489 Self::DEFAULT
4490 }
4491}
4492#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4493#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4494#[cfg_attr(feature = "serde", serde(tag = "type"))]
4495#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4496#[repr(u32)]
4497#[doc = "Video stream types"]
4498pub enum VideoStreamType {
4499 #[doc = "Stream is RTSP"]
4500 VIDEO_STREAM_TYPE_RTSP = 0,
4501 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4502 VIDEO_STREAM_TYPE_RTPUDP = 1,
4503 #[doc = "Stream is MPEG on TCP"]
4504 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4505 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4506 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4507}
4508impl VideoStreamType {
4509 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4510}
4511impl Default for VideoStreamType {
4512 fn default() -> Self {
4513 Self::DEFAULT
4514 }
4515}
4516#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4517#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4518#[cfg_attr(feature = "serde", serde(tag = "type"))]
4519#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4520#[repr(u32)]
4521#[doc = "Direction of VTOL transition"]
4522pub enum VtolTransitionHeading {
4523 #[doc = "Respect the heading configuration of the vehicle."]
4524 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4525 #[doc = "Use the heading pointing towards the next waypoint."]
4526 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4527 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4528 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4529 #[doc = "Use the specified heading in parameter 4."]
4530 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4531 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4532 VTOL_TRANSITION_HEADING_ANY = 4,
4533}
4534impl VtolTransitionHeading {
4535 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4536}
4537impl Default for VtolTransitionHeading {
4538 fn default() -> Self {
4539 Self::DEFAULT
4540 }
4541}
4542#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4543#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4544#[cfg_attr(feature = "serde", serde(tag = "type"))]
4545#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4546#[repr(u32)]
4547#[doc = "WiFi Mode."]
4548pub enum WifiConfigApMode {
4549 #[doc = "WiFi mode is undefined."]
4550 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4551 #[doc = "WiFi configured as an access point."]
4552 WIFI_CONFIG_AP_MODE_AP = 1,
4553 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4554 WIFI_CONFIG_AP_MODE_STATION = 2,
4555 #[doc = "WiFi disabled."]
4556 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4557}
4558impl WifiConfigApMode {
4559 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4560}
4561impl Default for WifiConfigApMode {
4562 fn default() -> Self {
4563 Self::DEFAULT
4564 }
4565}
4566#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4567#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4568#[cfg_attr(feature = "serde", serde(tag = "type"))]
4569#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4570#[repr(u32)]
4571#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4572pub enum WifiConfigApResponse {
4573 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4574 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4575 #[doc = "Changes accepted."]
4576 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4577 #[doc = "Changes rejected."]
4578 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4579 #[doc = "Invalid Mode."]
4580 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4581 #[doc = "Invalid SSID."]
4582 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4583 #[doc = "Invalid Password."]
4584 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4585}
4586impl WifiConfigApResponse {
4587 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4588}
4589impl Default for WifiConfigApResponse {
4590 fn default() -> Self {
4591 Self::DEFAULT
4592 }
4593}
4594#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4596#[cfg_attr(feature = "serde", serde(tag = "type"))]
4597#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4598#[repr(u32)]
4599#[doc = "Winch actions."]
4600pub enum WinchActions {
4601 #[doc = "Allow motor to freewheel."]
4602 WINCH_RELAXED = 0,
4603 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4604 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4605 #[doc = "Wind or unwind line at specified rate."]
4606 WINCH_RATE_CONTROL = 2,
4607 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4608 WINCH_LOCK = 3,
4609 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4610 WINCH_DELIVER = 4,
4611 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4612 WINCH_HOLD = 5,
4613 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4614 WINCH_RETRACT = 6,
4615 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4616 WINCH_LOAD_LINE = 7,
4617 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4618 WINCH_ABANDON_LINE = 8,
4619 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4620 WINCH_LOAD_PAYLOAD = 9,
4621}
4622impl WinchActions {
4623 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4624}
4625impl Default for WinchActions {
4626 fn default() -> Self {
4627 Self::DEFAULT
4628 }
4629}
4630#[doc = "id: 140"]
4631#[doc = "Set the vehicle attitude and body angular rates."]
4632#[derive(Debug, Clone, PartialEq)]
4633#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4635pub struct ACTUATOR_CONTROL_TARGET_DATA {
4636 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4637 pub time_usec: u64,
4638 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4639 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4640 pub controls: [f32; 8],
4641 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4642 pub group_mlx: u8,
4643}
4644impl ACTUATOR_CONTROL_TARGET_DATA {
4645 pub const ENCODED_LEN: usize = 41usize;
4646 pub const DEFAULT: Self = Self {
4647 time_usec: 0_u64,
4648 controls: [0.0_f32; 8usize],
4649 group_mlx: 0_u8,
4650 };
4651 #[cfg(feature = "arbitrary")]
4652 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4653 use arbitrary::{Arbitrary, Unstructured};
4654 let mut buf = [0u8; 1024];
4655 rng.fill_bytes(&mut buf);
4656 let mut unstructured = Unstructured::new(&buf);
4657 Self::arbitrary(&mut unstructured).unwrap_or_default()
4658 }
4659}
4660impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4661 fn default() -> Self {
4662 Self::DEFAULT.clone()
4663 }
4664}
4665impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4666 type Message = MavMessage;
4667 const ID: u32 = 140u32;
4668 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4669 const EXTRA_CRC: u8 = 181u8;
4670 const ENCODED_LEN: usize = 41usize;
4671 fn deser(
4672 _version: MavlinkVersion,
4673 __input: &[u8],
4674 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4675 let avail_len = __input.len();
4676 let mut payload_buf = [0; Self::ENCODED_LEN];
4677 let mut buf = if avail_len < Self::ENCODED_LEN {
4678 payload_buf[0..avail_len].copy_from_slice(__input);
4679 Bytes::new(&payload_buf)
4680 } else {
4681 Bytes::new(__input)
4682 };
4683 let mut __struct = Self::default();
4684 __struct.time_usec = buf.get_u64_le();
4685 for v in &mut __struct.controls {
4686 let val = buf.get_f32_le();
4687 *v = val;
4688 }
4689 __struct.group_mlx = buf.get_u8();
4690 Ok(__struct)
4691 }
4692 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4693 let mut __tmp = BytesMut::new(bytes);
4694 #[allow(clippy::absurd_extreme_comparisons)]
4695 #[allow(unused_comparisons)]
4696 if __tmp.remaining() < Self::ENCODED_LEN {
4697 panic!(
4698 "buffer is too small (need {} bytes, but got {})",
4699 Self::ENCODED_LEN,
4700 __tmp.remaining(),
4701 )
4702 }
4703 __tmp.put_u64_le(self.time_usec);
4704 for val in &self.controls {
4705 __tmp.put_f32_le(*val);
4706 }
4707 __tmp.put_u8(self.group_mlx);
4708 if matches!(version, MavlinkVersion::V2) {
4709 let len = __tmp.len();
4710 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4711 } else {
4712 __tmp.len()
4713 }
4714 }
4715}
4716#[doc = "id: 375"]
4717#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4718#[derive(Debug, Clone, PartialEq)]
4719#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4720#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4721pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4722 #[doc = "Timestamp (since system boot)."]
4723 pub time_usec: u64,
4724 #[doc = "Active outputs"]
4725 pub active: u32,
4726 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4727 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4728 pub actuator: [f32; 32],
4729}
4730impl ACTUATOR_OUTPUT_STATUS_DATA {
4731 pub const ENCODED_LEN: usize = 140usize;
4732 pub const DEFAULT: Self = Self {
4733 time_usec: 0_u64,
4734 active: 0_u32,
4735 actuator: [0.0_f32; 32usize],
4736 };
4737 #[cfg(feature = "arbitrary")]
4738 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4739 use arbitrary::{Arbitrary, Unstructured};
4740 let mut buf = [0u8; 1024];
4741 rng.fill_bytes(&mut buf);
4742 let mut unstructured = Unstructured::new(&buf);
4743 Self::arbitrary(&mut unstructured).unwrap_or_default()
4744 }
4745}
4746impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4747 fn default() -> Self {
4748 Self::DEFAULT.clone()
4749 }
4750}
4751impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4752 type Message = MavMessage;
4753 const ID: u32 = 375u32;
4754 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4755 const EXTRA_CRC: u8 = 251u8;
4756 const ENCODED_LEN: usize = 140usize;
4757 fn deser(
4758 _version: MavlinkVersion,
4759 __input: &[u8],
4760 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4761 let avail_len = __input.len();
4762 let mut payload_buf = [0; Self::ENCODED_LEN];
4763 let mut buf = if avail_len < Self::ENCODED_LEN {
4764 payload_buf[0..avail_len].copy_from_slice(__input);
4765 Bytes::new(&payload_buf)
4766 } else {
4767 Bytes::new(__input)
4768 };
4769 let mut __struct = Self::default();
4770 __struct.time_usec = buf.get_u64_le();
4771 __struct.active = buf.get_u32_le();
4772 for v in &mut __struct.actuator {
4773 let val = buf.get_f32_le();
4774 *v = val;
4775 }
4776 Ok(__struct)
4777 }
4778 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4779 let mut __tmp = BytesMut::new(bytes);
4780 #[allow(clippy::absurd_extreme_comparisons)]
4781 #[allow(unused_comparisons)]
4782 if __tmp.remaining() < Self::ENCODED_LEN {
4783 panic!(
4784 "buffer is too small (need {} bytes, but got {})",
4785 Self::ENCODED_LEN,
4786 __tmp.remaining(),
4787 )
4788 }
4789 __tmp.put_u64_le(self.time_usec);
4790 __tmp.put_u32_le(self.active);
4791 for val in &self.actuator {
4792 __tmp.put_f32_le(*val);
4793 }
4794 if matches!(version, MavlinkVersion::V2) {
4795 let len = __tmp.len();
4796 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4797 } else {
4798 __tmp.len()
4799 }
4800 }
4801}
4802#[doc = "id: 246"]
4803#[doc = "The location and information of an ADSB vehicle."]
4804#[derive(Debug, Clone, PartialEq)]
4805#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4806#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4807pub struct ADSB_VEHICLE_DATA {
4808 #[doc = "ICAO address"]
4809 pub ICAO_address: u32,
4810 #[doc = "Latitude"]
4811 pub lat: i32,
4812 #[doc = "Longitude"]
4813 pub lon: i32,
4814 #[doc = "Altitude(ASL)"]
4815 pub altitude: i32,
4816 #[doc = "Course over ground"]
4817 pub heading: u16,
4818 #[doc = "The horizontal velocity"]
4819 pub hor_velocity: u16,
4820 #[doc = "The vertical velocity. Positive is up"]
4821 pub ver_velocity: i16,
4822 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4823 pub flags: AdsbFlags,
4824 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4825 pub squawk: u16,
4826 #[doc = "ADSB altitude type."]
4827 pub altitude_type: AdsbAltitudeType,
4828 #[doc = "The callsign, 8+null"]
4829 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4830 pub callsign: [u8; 9],
4831 #[doc = "ADSB emitter type."]
4832 pub emitter_type: AdsbEmitterType,
4833 #[doc = "Time since last communication in seconds"]
4834 pub tslc: u8,
4835}
4836impl ADSB_VEHICLE_DATA {
4837 pub const ENCODED_LEN: usize = 38usize;
4838 pub const DEFAULT: Self = Self {
4839 ICAO_address: 0_u32,
4840 lat: 0_i32,
4841 lon: 0_i32,
4842 altitude: 0_i32,
4843 heading: 0_u16,
4844 hor_velocity: 0_u16,
4845 ver_velocity: 0_i16,
4846 flags: AdsbFlags::DEFAULT,
4847 squawk: 0_u16,
4848 altitude_type: AdsbAltitudeType::DEFAULT,
4849 callsign: [0_u8; 9usize],
4850 emitter_type: AdsbEmitterType::DEFAULT,
4851 tslc: 0_u8,
4852 };
4853 #[cfg(feature = "arbitrary")]
4854 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4855 use arbitrary::{Arbitrary, Unstructured};
4856 let mut buf = [0u8; 1024];
4857 rng.fill_bytes(&mut buf);
4858 let mut unstructured = Unstructured::new(&buf);
4859 Self::arbitrary(&mut unstructured).unwrap_or_default()
4860 }
4861}
4862impl Default for ADSB_VEHICLE_DATA {
4863 fn default() -> Self {
4864 Self::DEFAULT.clone()
4865 }
4866}
4867impl MessageData for ADSB_VEHICLE_DATA {
4868 type Message = MavMessage;
4869 const ID: u32 = 246u32;
4870 const NAME: &'static str = "ADSB_VEHICLE";
4871 const EXTRA_CRC: u8 = 184u8;
4872 const ENCODED_LEN: usize = 38usize;
4873 fn deser(
4874 _version: MavlinkVersion,
4875 __input: &[u8],
4876 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4877 let avail_len = __input.len();
4878 let mut payload_buf = [0; Self::ENCODED_LEN];
4879 let mut buf = if avail_len < Self::ENCODED_LEN {
4880 payload_buf[0..avail_len].copy_from_slice(__input);
4881 Bytes::new(&payload_buf)
4882 } else {
4883 Bytes::new(__input)
4884 };
4885 let mut __struct = Self::default();
4886 __struct.ICAO_address = buf.get_u32_le();
4887 __struct.lat = buf.get_i32_le();
4888 __struct.lon = buf.get_i32_le();
4889 __struct.altitude = buf.get_i32_le();
4890 __struct.heading = buf.get_u16_le();
4891 __struct.hor_velocity = buf.get_u16_le();
4892 __struct.ver_velocity = buf.get_i16_le();
4893 let tmp = buf.get_u16_le();
4894 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4895 ::mavlink_core::error::ParserError::InvalidFlag {
4896 flag_type: "AdsbFlags",
4897 value: tmp as u32,
4898 },
4899 )?;
4900 __struct.squawk = buf.get_u16_le();
4901 let tmp = buf.get_u8();
4902 __struct.altitude_type =
4903 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4904 enum_type: "AdsbAltitudeType",
4905 value: tmp as u32,
4906 })?;
4907 for v in &mut __struct.callsign {
4908 let val = buf.get_u8();
4909 *v = val;
4910 }
4911 let tmp = buf.get_u8();
4912 __struct.emitter_type =
4913 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4914 enum_type: "AdsbEmitterType",
4915 value: tmp as u32,
4916 })?;
4917 __struct.tslc = buf.get_u8();
4918 Ok(__struct)
4919 }
4920 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4921 let mut __tmp = BytesMut::new(bytes);
4922 #[allow(clippy::absurd_extreme_comparisons)]
4923 #[allow(unused_comparisons)]
4924 if __tmp.remaining() < Self::ENCODED_LEN {
4925 panic!(
4926 "buffer is too small (need {} bytes, but got {})",
4927 Self::ENCODED_LEN,
4928 __tmp.remaining(),
4929 )
4930 }
4931 __tmp.put_u32_le(self.ICAO_address);
4932 __tmp.put_i32_le(self.lat);
4933 __tmp.put_i32_le(self.lon);
4934 __tmp.put_i32_le(self.altitude);
4935 __tmp.put_u16_le(self.heading);
4936 __tmp.put_u16_le(self.hor_velocity);
4937 __tmp.put_i16_le(self.ver_velocity);
4938 __tmp.put_u16_le(self.flags.bits());
4939 __tmp.put_u16_le(self.squawk);
4940 __tmp.put_u8(self.altitude_type as u8);
4941 for val in &self.callsign {
4942 __tmp.put_u8(*val);
4943 }
4944 __tmp.put_u8(self.emitter_type as u8);
4945 __tmp.put_u8(self.tslc);
4946 if matches!(version, MavlinkVersion::V2) {
4947 let len = __tmp.len();
4948 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4949 } else {
4950 __tmp.len()
4951 }
4952 }
4953}
4954#[doc = "id: 295"]
4955#[doc = "Airspeed information from a sensor."]
4956#[derive(Debug, Clone, PartialEq)]
4957#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4958#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4959pub struct AIRSPEED_DATA {
4960 #[doc = "Calibrated airspeed (CAS)."]
4961 pub airspeed: f32,
4962 #[doc = "Raw differential pressure. NaN for value unknown/not supplied."]
4963 pub raw_press: f32,
4964 #[doc = "Temperature. INT16_MAX for value unknown/not supplied."]
4965 pub temperature: i16,
4966 #[doc = "Sensor ID."]
4967 pub id: u8,
4968 #[doc = "Airspeed sensor flags."]
4969 pub flags: AirspeedSensorFlags,
4970}
4971impl AIRSPEED_DATA {
4972 pub const ENCODED_LEN: usize = 12usize;
4973 pub const DEFAULT: Self = Self {
4974 airspeed: 0.0_f32,
4975 raw_press: 0.0_f32,
4976 temperature: 0_i16,
4977 id: 0_u8,
4978 flags: AirspeedSensorFlags::DEFAULT,
4979 };
4980 #[cfg(feature = "arbitrary")]
4981 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4982 use arbitrary::{Arbitrary, Unstructured};
4983 let mut buf = [0u8; 1024];
4984 rng.fill_bytes(&mut buf);
4985 let mut unstructured = Unstructured::new(&buf);
4986 Self::arbitrary(&mut unstructured).unwrap_or_default()
4987 }
4988}
4989impl Default for AIRSPEED_DATA {
4990 fn default() -> Self {
4991 Self::DEFAULT.clone()
4992 }
4993}
4994impl MessageData for AIRSPEED_DATA {
4995 type Message = MavMessage;
4996 const ID: u32 = 295u32;
4997 const NAME: &'static str = "AIRSPEED";
4998 const EXTRA_CRC: u8 = 234u8;
4999 const ENCODED_LEN: usize = 12usize;
5000 fn deser(
5001 _version: MavlinkVersion,
5002 __input: &[u8],
5003 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5004 let avail_len = __input.len();
5005 let mut payload_buf = [0; Self::ENCODED_LEN];
5006 let mut buf = if avail_len < Self::ENCODED_LEN {
5007 payload_buf[0..avail_len].copy_from_slice(__input);
5008 Bytes::new(&payload_buf)
5009 } else {
5010 Bytes::new(__input)
5011 };
5012 let mut __struct = Self::default();
5013 __struct.airspeed = buf.get_f32_le();
5014 __struct.raw_press = buf.get_f32_le();
5015 __struct.temperature = buf.get_i16_le();
5016 __struct.id = buf.get_u8();
5017 let tmp = buf.get_u8();
5018 __struct.flags = AirspeedSensorFlags::from_bits(tmp & AirspeedSensorFlags::all().bits())
5019 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5020 flag_type: "AirspeedSensorFlags",
5021 value: tmp as u32,
5022 })?;
5023 Ok(__struct)
5024 }
5025 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5026 let mut __tmp = BytesMut::new(bytes);
5027 #[allow(clippy::absurd_extreme_comparisons)]
5028 #[allow(unused_comparisons)]
5029 if __tmp.remaining() < Self::ENCODED_LEN {
5030 panic!(
5031 "buffer is too small (need {} bytes, but got {})",
5032 Self::ENCODED_LEN,
5033 __tmp.remaining(),
5034 )
5035 }
5036 __tmp.put_f32_le(self.airspeed);
5037 __tmp.put_f32_le(self.raw_press);
5038 __tmp.put_i16_le(self.temperature);
5039 __tmp.put_u8(self.id);
5040 __tmp.put_u8(self.flags.bits());
5041 if matches!(version, MavlinkVersion::V2) {
5042 let len = __tmp.len();
5043 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5044 } else {
5045 __tmp.len()
5046 }
5047 }
5048}
5049#[doc = "id: 301"]
5050#[doc = "The location and information of an AIS vessel."]
5051#[derive(Debug, Clone, PartialEq)]
5052#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5053#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5054pub struct AIS_VESSEL_DATA {
5055 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5056 pub MMSI: u32,
5057 #[doc = "Latitude"]
5058 pub lat: i32,
5059 #[doc = "Longitude"]
5060 pub lon: i32,
5061 #[doc = "Course over ground"]
5062 pub COG: u16,
5063 #[doc = "True heading"]
5064 pub heading: u16,
5065 #[doc = "Speed over ground"]
5066 pub velocity: u16,
5067 #[doc = "Distance from lat/lon location to bow"]
5068 pub dimension_bow: u16,
5069 #[doc = "Distance from lat/lon location to stern"]
5070 pub dimension_stern: u16,
5071 #[doc = "Time since last communication in seconds"]
5072 pub tslc: u16,
5073 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5074 pub flags: AisFlags,
5075 #[doc = "Turn rate"]
5076 pub turn_rate: i8,
5077 #[doc = "Navigational status"]
5078 pub navigational_status: AisNavStatus,
5079 #[doc = "Type of vessels"]
5080 pub mavtype: AisType,
5081 #[doc = "Distance from lat/lon location to port side"]
5082 pub dimension_port: u8,
5083 #[doc = "Distance from lat/lon location to starboard side"]
5084 pub dimension_starboard: u8,
5085 #[doc = "The vessel callsign"]
5086 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5087 pub callsign: [u8; 7],
5088 #[doc = "The vessel name"]
5089 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5090 pub name: [u8; 20],
5091}
5092impl AIS_VESSEL_DATA {
5093 pub const ENCODED_LEN: usize = 58usize;
5094 pub const DEFAULT: Self = Self {
5095 MMSI: 0_u32,
5096 lat: 0_i32,
5097 lon: 0_i32,
5098 COG: 0_u16,
5099 heading: 0_u16,
5100 velocity: 0_u16,
5101 dimension_bow: 0_u16,
5102 dimension_stern: 0_u16,
5103 tslc: 0_u16,
5104 flags: AisFlags::DEFAULT,
5105 turn_rate: 0_i8,
5106 navigational_status: AisNavStatus::DEFAULT,
5107 mavtype: AisType::DEFAULT,
5108 dimension_port: 0_u8,
5109 dimension_starboard: 0_u8,
5110 callsign: [0_u8; 7usize],
5111 name: [0_u8; 20usize],
5112 };
5113 #[cfg(feature = "arbitrary")]
5114 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5115 use arbitrary::{Arbitrary, Unstructured};
5116 let mut buf = [0u8; 1024];
5117 rng.fill_bytes(&mut buf);
5118 let mut unstructured = Unstructured::new(&buf);
5119 Self::arbitrary(&mut unstructured).unwrap_or_default()
5120 }
5121}
5122impl Default for AIS_VESSEL_DATA {
5123 fn default() -> Self {
5124 Self::DEFAULT.clone()
5125 }
5126}
5127impl MessageData for AIS_VESSEL_DATA {
5128 type Message = MavMessage;
5129 const ID: u32 = 301u32;
5130 const NAME: &'static str = "AIS_VESSEL";
5131 const EXTRA_CRC: u8 = 243u8;
5132 const ENCODED_LEN: usize = 58usize;
5133 fn deser(
5134 _version: MavlinkVersion,
5135 __input: &[u8],
5136 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5137 let avail_len = __input.len();
5138 let mut payload_buf = [0; Self::ENCODED_LEN];
5139 let mut buf = if avail_len < Self::ENCODED_LEN {
5140 payload_buf[0..avail_len].copy_from_slice(__input);
5141 Bytes::new(&payload_buf)
5142 } else {
5143 Bytes::new(__input)
5144 };
5145 let mut __struct = Self::default();
5146 __struct.MMSI = buf.get_u32_le();
5147 __struct.lat = buf.get_i32_le();
5148 __struct.lon = buf.get_i32_le();
5149 __struct.COG = buf.get_u16_le();
5150 __struct.heading = buf.get_u16_le();
5151 __struct.velocity = buf.get_u16_le();
5152 __struct.dimension_bow = buf.get_u16_le();
5153 __struct.dimension_stern = buf.get_u16_le();
5154 __struct.tslc = buf.get_u16_le();
5155 let tmp = buf.get_u16_le();
5156 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
5157 ::mavlink_core::error::ParserError::InvalidFlag {
5158 flag_type: "AisFlags",
5159 value: tmp as u32,
5160 },
5161 )?;
5162 __struct.turn_rate = buf.get_i8();
5163 let tmp = buf.get_u8();
5164 __struct.navigational_status =
5165 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5166 enum_type: "AisNavStatus",
5167 value: tmp as u32,
5168 })?;
5169 let tmp = buf.get_u8();
5170 __struct.mavtype =
5171 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5172 enum_type: "AisType",
5173 value: tmp as u32,
5174 })?;
5175 __struct.dimension_port = buf.get_u8();
5176 __struct.dimension_starboard = buf.get_u8();
5177 for v in &mut __struct.callsign {
5178 let val = buf.get_u8();
5179 *v = val;
5180 }
5181 for v in &mut __struct.name {
5182 let val = buf.get_u8();
5183 *v = val;
5184 }
5185 Ok(__struct)
5186 }
5187 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5188 let mut __tmp = BytesMut::new(bytes);
5189 #[allow(clippy::absurd_extreme_comparisons)]
5190 #[allow(unused_comparisons)]
5191 if __tmp.remaining() < Self::ENCODED_LEN {
5192 panic!(
5193 "buffer is too small (need {} bytes, but got {})",
5194 Self::ENCODED_LEN,
5195 __tmp.remaining(),
5196 )
5197 }
5198 __tmp.put_u32_le(self.MMSI);
5199 __tmp.put_i32_le(self.lat);
5200 __tmp.put_i32_le(self.lon);
5201 __tmp.put_u16_le(self.COG);
5202 __tmp.put_u16_le(self.heading);
5203 __tmp.put_u16_le(self.velocity);
5204 __tmp.put_u16_le(self.dimension_bow);
5205 __tmp.put_u16_le(self.dimension_stern);
5206 __tmp.put_u16_le(self.tslc);
5207 __tmp.put_u16_le(self.flags.bits());
5208 __tmp.put_i8(self.turn_rate);
5209 __tmp.put_u8(self.navigational_status as u8);
5210 __tmp.put_u8(self.mavtype as u8);
5211 __tmp.put_u8(self.dimension_port);
5212 __tmp.put_u8(self.dimension_starboard);
5213 for val in &self.callsign {
5214 __tmp.put_u8(*val);
5215 }
5216 for val in &self.name {
5217 __tmp.put_u8(*val);
5218 }
5219 if matches!(version, MavlinkVersion::V2) {
5220 let len = __tmp.len();
5221 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5222 } else {
5223 __tmp.len()
5224 }
5225 }
5226}
5227#[doc = "id: 141"]
5228#[doc = "The current system altitude."]
5229#[derive(Debug, Clone, PartialEq)]
5230#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5231#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5232pub struct ALTITUDE_DATA {
5233 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5234 pub time_usec: u64,
5235 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5236 pub altitude_monotonic: f32,
5237 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5238 pub altitude_amsl: f32,
5239 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5240 pub altitude_local: f32,
5241 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5242 pub altitude_relative: f32,
5243 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5244 pub altitude_terrain: f32,
5245 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5246 pub bottom_clearance: f32,
5247}
5248impl ALTITUDE_DATA {
5249 pub const ENCODED_LEN: usize = 32usize;
5250 pub const DEFAULT: Self = Self {
5251 time_usec: 0_u64,
5252 altitude_monotonic: 0.0_f32,
5253 altitude_amsl: 0.0_f32,
5254 altitude_local: 0.0_f32,
5255 altitude_relative: 0.0_f32,
5256 altitude_terrain: 0.0_f32,
5257 bottom_clearance: 0.0_f32,
5258 };
5259 #[cfg(feature = "arbitrary")]
5260 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5261 use arbitrary::{Arbitrary, Unstructured};
5262 let mut buf = [0u8; 1024];
5263 rng.fill_bytes(&mut buf);
5264 let mut unstructured = Unstructured::new(&buf);
5265 Self::arbitrary(&mut unstructured).unwrap_or_default()
5266 }
5267}
5268impl Default for ALTITUDE_DATA {
5269 fn default() -> Self {
5270 Self::DEFAULT.clone()
5271 }
5272}
5273impl MessageData for ALTITUDE_DATA {
5274 type Message = MavMessage;
5275 const ID: u32 = 141u32;
5276 const NAME: &'static str = "ALTITUDE";
5277 const EXTRA_CRC: u8 = 47u8;
5278 const ENCODED_LEN: usize = 32usize;
5279 fn deser(
5280 _version: MavlinkVersion,
5281 __input: &[u8],
5282 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5283 let avail_len = __input.len();
5284 let mut payload_buf = [0; Self::ENCODED_LEN];
5285 let mut buf = if avail_len < Self::ENCODED_LEN {
5286 payload_buf[0..avail_len].copy_from_slice(__input);
5287 Bytes::new(&payload_buf)
5288 } else {
5289 Bytes::new(__input)
5290 };
5291 let mut __struct = Self::default();
5292 __struct.time_usec = buf.get_u64_le();
5293 __struct.altitude_monotonic = buf.get_f32_le();
5294 __struct.altitude_amsl = buf.get_f32_le();
5295 __struct.altitude_local = buf.get_f32_le();
5296 __struct.altitude_relative = buf.get_f32_le();
5297 __struct.altitude_terrain = buf.get_f32_le();
5298 __struct.bottom_clearance = buf.get_f32_le();
5299 Ok(__struct)
5300 }
5301 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5302 let mut __tmp = BytesMut::new(bytes);
5303 #[allow(clippy::absurd_extreme_comparisons)]
5304 #[allow(unused_comparisons)]
5305 if __tmp.remaining() < Self::ENCODED_LEN {
5306 panic!(
5307 "buffer is too small (need {} bytes, but got {})",
5308 Self::ENCODED_LEN,
5309 __tmp.remaining(),
5310 )
5311 }
5312 __tmp.put_u64_le(self.time_usec);
5313 __tmp.put_f32_le(self.altitude_monotonic);
5314 __tmp.put_f32_le(self.altitude_amsl);
5315 __tmp.put_f32_le(self.altitude_local);
5316 __tmp.put_f32_le(self.altitude_relative);
5317 __tmp.put_f32_le(self.altitude_terrain);
5318 __tmp.put_f32_le(self.bottom_clearance);
5319 if matches!(version, MavlinkVersion::V2) {
5320 let len = __tmp.len();
5321 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5322 } else {
5323 __tmp.len()
5324 }
5325 }
5326}
5327#[doc = "id: 30"]
5328#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5329#[derive(Debug, Clone, PartialEq)]
5330#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5331#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5332pub struct ATTITUDE_DATA {
5333 #[doc = "Timestamp (time since system boot)."]
5334 pub time_boot_ms: u32,
5335 #[doc = "Roll angle (-pi..+pi)"]
5336 pub roll: f32,
5337 #[doc = "Pitch angle (-pi..+pi)"]
5338 pub pitch: f32,
5339 #[doc = "Yaw angle (-pi..+pi)"]
5340 pub yaw: f32,
5341 #[doc = "Roll angular speed"]
5342 pub rollspeed: f32,
5343 #[doc = "Pitch angular speed"]
5344 pub pitchspeed: f32,
5345 #[doc = "Yaw angular speed"]
5346 pub yawspeed: f32,
5347}
5348impl ATTITUDE_DATA {
5349 pub const ENCODED_LEN: usize = 28usize;
5350 pub const DEFAULT: Self = Self {
5351 time_boot_ms: 0_u32,
5352 roll: 0.0_f32,
5353 pitch: 0.0_f32,
5354 yaw: 0.0_f32,
5355 rollspeed: 0.0_f32,
5356 pitchspeed: 0.0_f32,
5357 yawspeed: 0.0_f32,
5358 };
5359 #[cfg(feature = "arbitrary")]
5360 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5361 use arbitrary::{Arbitrary, Unstructured};
5362 let mut buf = [0u8; 1024];
5363 rng.fill_bytes(&mut buf);
5364 let mut unstructured = Unstructured::new(&buf);
5365 Self::arbitrary(&mut unstructured).unwrap_or_default()
5366 }
5367}
5368impl Default for ATTITUDE_DATA {
5369 fn default() -> Self {
5370 Self::DEFAULT.clone()
5371 }
5372}
5373impl MessageData for ATTITUDE_DATA {
5374 type Message = MavMessage;
5375 const ID: u32 = 30u32;
5376 const NAME: &'static str = "ATTITUDE";
5377 const EXTRA_CRC: u8 = 39u8;
5378 const ENCODED_LEN: usize = 28usize;
5379 fn deser(
5380 _version: MavlinkVersion,
5381 __input: &[u8],
5382 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5383 let avail_len = __input.len();
5384 let mut payload_buf = [0; Self::ENCODED_LEN];
5385 let mut buf = if avail_len < Self::ENCODED_LEN {
5386 payload_buf[0..avail_len].copy_from_slice(__input);
5387 Bytes::new(&payload_buf)
5388 } else {
5389 Bytes::new(__input)
5390 };
5391 let mut __struct = Self::default();
5392 __struct.time_boot_ms = buf.get_u32_le();
5393 __struct.roll = buf.get_f32_le();
5394 __struct.pitch = buf.get_f32_le();
5395 __struct.yaw = buf.get_f32_le();
5396 __struct.rollspeed = buf.get_f32_le();
5397 __struct.pitchspeed = buf.get_f32_le();
5398 __struct.yawspeed = buf.get_f32_le();
5399 Ok(__struct)
5400 }
5401 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5402 let mut __tmp = BytesMut::new(bytes);
5403 #[allow(clippy::absurd_extreme_comparisons)]
5404 #[allow(unused_comparisons)]
5405 if __tmp.remaining() < Self::ENCODED_LEN {
5406 panic!(
5407 "buffer is too small (need {} bytes, but got {})",
5408 Self::ENCODED_LEN,
5409 __tmp.remaining(),
5410 )
5411 }
5412 __tmp.put_u32_le(self.time_boot_ms);
5413 __tmp.put_f32_le(self.roll);
5414 __tmp.put_f32_le(self.pitch);
5415 __tmp.put_f32_le(self.yaw);
5416 __tmp.put_f32_le(self.rollspeed);
5417 __tmp.put_f32_le(self.pitchspeed);
5418 __tmp.put_f32_le(self.yawspeed);
5419 if matches!(version, MavlinkVersion::V2) {
5420 let len = __tmp.len();
5421 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5422 } else {
5423 __tmp.len()
5424 }
5425 }
5426}
5427#[doc = "id: 31"]
5428#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5429#[derive(Debug, Clone, PartialEq)]
5430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5431#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5432pub struct ATTITUDE_QUATERNION_DATA {
5433 #[doc = "Timestamp (time since system boot)."]
5434 pub time_boot_ms: u32,
5435 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5436 pub q1: f32,
5437 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5438 pub q2: f32,
5439 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5440 pub q3: f32,
5441 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5442 pub q4: f32,
5443 #[doc = "Roll angular speed"]
5444 pub rollspeed: f32,
5445 #[doc = "Pitch angular speed"]
5446 pub pitchspeed: f32,
5447 #[doc = "Yaw angular speed"]
5448 pub yawspeed: f32,
5449 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5450 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5451 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5452 pub repr_offset_q: [f32; 4],
5453}
5454impl ATTITUDE_QUATERNION_DATA {
5455 pub const ENCODED_LEN: usize = 48usize;
5456 pub const DEFAULT: Self = Self {
5457 time_boot_ms: 0_u32,
5458 q1: 0.0_f32,
5459 q2: 0.0_f32,
5460 q3: 0.0_f32,
5461 q4: 0.0_f32,
5462 rollspeed: 0.0_f32,
5463 pitchspeed: 0.0_f32,
5464 yawspeed: 0.0_f32,
5465 repr_offset_q: [0.0_f32; 4usize],
5466 };
5467 #[cfg(feature = "arbitrary")]
5468 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5469 use arbitrary::{Arbitrary, Unstructured};
5470 let mut buf = [0u8; 1024];
5471 rng.fill_bytes(&mut buf);
5472 let mut unstructured = Unstructured::new(&buf);
5473 Self::arbitrary(&mut unstructured).unwrap_or_default()
5474 }
5475}
5476impl Default for ATTITUDE_QUATERNION_DATA {
5477 fn default() -> Self {
5478 Self::DEFAULT.clone()
5479 }
5480}
5481impl MessageData for ATTITUDE_QUATERNION_DATA {
5482 type Message = MavMessage;
5483 const ID: u32 = 31u32;
5484 const NAME: &'static str = "ATTITUDE_QUATERNION";
5485 const EXTRA_CRC: u8 = 246u8;
5486 const ENCODED_LEN: usize = 48usize;
5487 fn deser(
5488 _version: MavlinkVersion,
5489 __input: &[u8],
5490 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5491 let avail_len = __input.len();
5492 let mut payload_buf = [0; Self::ENCODED_LEN];
5493 let mut buf = if avail_len < Self::ENCODED_LEN {
5494 payload_buf[0..avail_len].copy_from_slice(__input);
5495 Bytes::new(&payload_buf)
5496 } else {
5497 Bytes::new(__input)
5498 };
5499 let mut __struct = Self::default();
5500 __struct.time_boot_ms = buf.get_u32_le();
5501 __struct.q1 = buf.get_f32_le();
5502 __struct.q2 = buf.get_f32_le();
5503 __struct.q3 = buf.get_f32_le();
5504 __struct.q4 = buf.get_f32_le();
5505 __struct.rollspeed = buf.get_f32_le();
5506 __struct.pitchspeed = buf.get_f32_le();
5507 __struct.yawspeed = buf.get_f32_le();
5508 for v in &mut __struct.repr_offset_q {
5509 let val = buf.get_f32_le();
5510 *v = val;
5511 }
5512 Ok(__struct)
5513 }
5514 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5515 let mut __tmp = BytesMut::new(bytes);
5516 #[allow(clippy::absurd_extreme_comparisons)]
5517 #[allow(unused_comparisons)]
5518 if __tmp.remaining() < Self::ENCODED_LEN {
5519 panic!(
5520 "buffer is too small (need {} bytes, but got {})",
5521 Self::ENCODED_LEN,
5522 __tmp.remaining(),
5523 )
5524 }
5525 __tmp.put_u32_le(self.time_boot_ms);
5526 __tmp.put_f32_le(self.q1);
5527 __tmp.put_f32_le(self.q2);
5528 __tmp.put_f32_le(self.q3);
5529 __tmp.put_f32_le(self.q4);
5530 __tmp.put_f32_le(self.rollspeed);
5531 __tmp.put_f32_le(self.pitchspeed);
5532 __tmp.put_f32_le(self.yawspeed);
5533 for val in &self.repr_offset_q {
5534 __tmp.put_f32_le(*val);
5535 }
5536 if matches!(version, MavlinkVersion::V2) {
5537 let len = __tmp.len();
5538 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5539 } else {
5540 __tmp.len()
5541 }
5542 }
5543}
5544#[doc = "id: 61"]
5545#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5546#[derive(Debug, Clone, PartialEq)]
5547#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5549pub struct ATTITUDE_QUATERNION_COV_DATA {
5550 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5551 pub time_usec: u64,
5552 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5553 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5554 pub q: [f32; 4],
5555 #[doc = "Roll angular speed"]
5556 pub rollspeed: f32,
5557 #[doc = "Pitch angular speed"]
5558 pub pitchspeed: f32,
5559 #[doc = "Yaw angular speed"]
5560 pub yawspeed: f32,
5561 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5562 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5563 pub covariance: [f32; 9],
5564}
5565impl ATTITUDE_QUATERNION_COV_DATA {
5566 pub const ENCODED_LEN: usize = 72usize;
5567 pub const DEFAULT: Self = Self {
5568 time_usec: 0_u64,
5569 q: [0.0_f32; 4usize],
5570 rollspeed: 0.0_f32,
5571 pitchspeed: 0.0_f32,
5572 yawspeed: 0.0_f32,
5573 covariance: [0.0_f32; 9usize],
5574 };
5575 #[cfg(feature = "arbitrary")]
5576 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5577 use arbitrary::{Arbitrary, Unstructured};
5578 let mut buf = [0u8; 1024];
5579 rng.fill_bytes(&mut buf);
5580 let mut unstructured = Unstructured::new(&buf);
5581 Self::arbitrary(&mut unstructured).unwrap_or_default()
5582 }
5583}
5584impl Default for ATTITUDE_QUATERNION_COV_DATA {
5585 fn default() -> Self {
5586 Self::DEFAULT.clone()
5587 }
5588}
5589impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5590 type Message = MavMessage;
5591 const ID: u32 = 61u32;
5592 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5593 const EXTRA_CRC: u8 = 167u8;
5594 const ENCODED_LEN: usize = 72usize;
5595 fn deser(
5596 _version: MavlinkVersion,
5597 __input: &[u8],
5598 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5599 let avail_len = __input.len();
5600 let mut payload_buf = [0; Self::ENCODED_LEN];
5601 let mut buf = if avail_len < Self::ENCODED_LEN {
5602 payload_buf[0..avail_len].copy_from_slice(__input);
5603 Bytes::new(&payload_buf)
5604 } else {
5605 Bytes::new(__input)
5606 };
5607 let mut __struct = Self::default();
5608 __struct.time_usec = buf.get_u64_le();
5609 for v in &mut __struct.q {
5610 let val = buf.get_f32_le();
5611 *v = val;
5612 }
5613 __struct.rollspeed = buf.get_f32_le();
5614 __struct.pitchspeed = buf.get_f32_le();
5615 __struct.yawspeed = buf.get_f32_le();
5616 for v in &mut __struct.covariance {
5617 let val = buf.get_f32_le();
5618 *v = val;
5619 }
5620 Ok(__struct)
5621 }
5622 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5623 let mut __tmp = BytesMut::new(bytes);
5624 #[allow(clippy::absurd_extreme_comparisons)]
5625 #[allow(unused_comparisons)]
5626 if __tmp.remaining() < Self::ENCODED_LEN {
5627 panic!(
5628 "buffer is too small (need {} bytes, but got {})",
5629 Self::ENCODED_LEN,
5630 __tmp.remaining(),
5631 )
5632 }
5633 __tmp.put_u64_le(self.time_usec);
5634 for val in &self.q {
5635 __tmp.put_f32_le(*val);
5636 }
5637 __tmp.put_f32_le(self.rollspeed);
5638 __tmp.put_f32_le(self.pitchspeed);
5639 __tmp.put_f32_le(self.yawspeed);
5640 for val in &self.covariance {
5641 __tmp.put_f32_le(*val);
5642 }
5643 if matches!(version, MavlinkVersion::V2) {
5644 let len = __tmp.len();
5645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5646 } else {
5647 __tmp.len()
5648 }
5649 }
5650}
5651#[doc = "id: 83"]
5652#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5653#[derive(Debug, Clone, PartialEq)]
5654#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5655#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5656pub struct ATTITUDE_TARGET_DATA {
5657 #[doc = "Timestamp (time since system boot)."]
5658 pub time_boot_ms: u32,
5659 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5660 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5661 pub q: [f32; 4],
5662 #[doc = "Body roll rate"]
5663 pub body_roll_rate: f32,
5664 #[doc = "Body pitch rate"]
5665 pub body_pitch_rate: f32,
5666 #[doc = "Body yaw rate"]
5667 pub body_yaw_rate: f32,
5668 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5669 pub thrust: f32,
5670 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5671 pub type_mask: AttitudeTargetTypemask,
5672}
5673impl ATTITUDE_TARGET_DATA {
5674 pub const ENCODED_LEN: usize = 37usize;
5675 pub const DEFAULT: Self = Self {
5676 time_boot_ms: 0_u32,
5677 q: [0.0_f32; 4usize],
5678 body_roll_rate: 0.0_f32,
5679 body_pitch_rate: 0.0_f32,
5680 body_yaw_rate: 0.0_f32,
5681 thrust: 0.0_f32,
5682 type_mask: AttitudeTargetTypemask::DEFAULT,
5683 };
5684 #[cfg(feature = "arbitrary")]
5685 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5686 use arbitrary::{Arbitrary, Unstructured};
5687 let mut buf = [0u8; 1024];
5688 rng.fill_bytes(&mut buf);
5689 let mut unstructured = Unstructured::new(&buf);
5690 Self::arbitrary(&mut unstructured).unwrap_or_default()
5691 }
5692}
5693impl Default for ATTITUDE_TARGET_DATA {
5694 fn default() -> Self {
5695 Self::DEFAULT.clone()
5696 }
5697}
5698impl MessageData for ATTITUDE_TARGET_DATA {
5699 type Message = MavMessage;
5700 const ID: u32 = 83u32;
5701 const NAME: &'static str = "ATTITUDE_TARGET";
5702 const EXTRA_CRC: u8 = 22u8;
5703 const ENCODED_LEN: usize = 37usize;
5704 fn deser(
5705 _version: MavlinkVersion,
5706 __input: &[u8],
5707 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5708 let avail_len = __input.len();
5709 let mut payload_buf = [0; Self::ENCODED_LEN];
5710 let mut buf = if avail_len < Self::ENCODED_LEN {
5711 payload_buf[0..avail_len].copy_from_slice(__input);
5712 Bytes::new(&payload_buf)
5713 } else {
5714 Bytes::new(__input)
5715 };
5716 let mut __struct = Self::default();
5717 __struct.time_boot_ms = buf.get_u32_le();
5718 for v in &mut __struct.q {
5719 let val = buf.get_f32_le();
5720 *v = val;
5721 }
5722 __struct.body_roll_rate = buf.get_f32_le();
5723 __struct.body_pitch_rate = buf.get_f32_le();
5724 __struct.body_yaw_rate = buf.get_f32_le();
5725 __struct.thrust = buf.get_f32_le();
5726 let tmp = buf.get_u8();
5727 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5728 tmp & AttitudeTargetTypemask::all().bits(),
5729 )
5730 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5731 flag_type: "AttitudeTargetTypemask",
5732 value: tmp as u32,
5733 })?;
5734 Ok(__struct)
5735 }
5736 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5737 let mut __tmp = BytesMut::new(bytes);
5738 #[allow(clippy::absurd_extreme_comparisons)]
5739 #[allow(unused_comparisons)]
5740 if __tmp.remaining() < Self::ENCODED_LEN {
5741 panic!(
5742 "buffer is too small (need {} bytes, but got {})",
5743 Self::ENCODED_LEN,
5744 __tmp.remaining(),
5745 )
5746 }
5747 __tmp.put_u32_le(self.time_boot_ms);
5748 for val in &self.q {
5749 __tmp.put_f32_le(*val);
5750 }
5751 __tmp.put_f32_le(self.body_roll_rate);
5752 __tmp.put_f32_le(self.body_pitch_rate);
5753 __tmp.put_f32_le(self.body_yaw_rate);
5754 __tmp.put_f32_le(self.thrust);
5755 __tmp.put_u8(self.type_mask.bits());
5756 if matches!(version, MavlinkVersion::V2) {
5757 let len = __tmp.len();
5758 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5759 } else {
5760 __tmp.len()
5761 }
5762 }
5763}
5764#[doc = "id: 138"]
5765#[doc = "Motion capture attitude and position."]
5766#[derive(Debug, Clone, PartialEq)]
5767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5769pub struct ATT_POS_MOCAP_DATA {
5770 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5771 pub time_usec: u64,
5772 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5773 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5774 pub q: [f32; 4],
5775 #[doc = "X position (NED)"]
5776 pub x: f32,
5777 #[doc = "Y position (NED)"]
5778 pub y: f32,
5779 #[doc = "Z position (NED)"]
5780 pub z: f32,
5781 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5782 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5783 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5784 pub covariance: [f32; 21],
5785}
5786impl ATT_POS_MOCAP_DATA {
5787 pub const ENCODED_LEN: usize = 120usize;
5788 pub const DEFAULT: Self = Self {
5789 time_usec: 0_u64,
5790 q: [0.0_f32; 4usize],
5791 x: 0.0_f32,
5792 y: 0.0_f32,
5793 z: 0.0_f32,
5794 covariance: [0.0_f32; 21usize],
5795 };
5796 #[cfg(feature = "arbitrary")]
5797 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5798 use arbitrary::{Arbitrary, Unstructured};
5799 let mut buf = [0u8; 1024];
5800 rng.fill_bytes(&mut buf);
5801 let mut unstructured = Unstructured::new(&buf);
5802 Self::arbitrary(&mut unstructured).unwrap_or_default()
5803 }
5804}
5805impl Default for ATT_POS_MOCAP_DATA {
5806 fn default() -> Self {
5807 Self::DEFAULT.clone()
5808 }
5809}
5810impl MessageData for ATT_POS_MOCAP_DATA {
5811 type Message = MavMessage;
5812 const ID: u32 = 138u32;
5813 const NAME: &'static str = "ATT_POS_MOCAP";
5814 const EXTRA_CRC: u8 = 109u8;
5815 const ENCODED_LEN: usize = 120usize;
5816 fn deser(
5817 _version: MavlinkVersion,
5818 __input: &[u8],
5819 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5820 let avail_len = __input.len();
5821 let mut payload_buf = [0; Self::ENCODED_LEN];
5822 let mut buf = if avail_len < Self::ENCODED_LEN {
5823 payload_buf[0..avail_len].copy_from_slice(__input);
5824 Bytes::new(&payload_buf)
5825 } else {
5826 Bytes::new(__input)
5827 };
5828 let mut __struct = Self::default();
5829 __struct.time_usec = buf.get_u64_le();
5830 for v in &mut __struct.q {
5831 let val = buf.get_f32_le();
5832 *v = val;
5833 }
5834 __struct.x = buf.get_f32_le();
5835 __struct.y = buf.get_f32_le();
5836 __struct.z = buf.get_f32_le();
5837 for v in &mut __struct.covariance {
5838 let val = buf.get_f32_le();
5839 *v = val;
5840 }
5841 Ok(__struct)
5842 }
5843 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5844 let mut __tmp = BytesMut::new(bytes);
5845 #[allow(clippy::absurd_extreme_comparisons)]
5846 #[allow(unused_comparisons)]
5847 if __tmp.remaining() < Self::ENCODED_LEN {
5848 panic!(
5849 "buffer is too small (need {} bytes, but got {})",
5850 Self::ENCODED_LEN,
5851 __tmp.remaining(),
5852 )
5853 }
5854 __tmp.put_u64_le(self.time_usec);
5855 for val in &self.q {
5856 __tmp.put_f32_le(*val);
5857 }
5858 __tmp.put_f32_le(self.x);
5859 __tmp.put_f32_le(self.y);
5860 __tmp.put_f32_le(self.z);
5861 for val in &self.covariance {
5862 __tmp.put_f32_le(*val);
5863 }
5864 if matches!(version, MavlinkVersion::V2) {
5865 let len = __tmp.len();
5866 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5867 } else {
5868 __tmp.len()
5869 }
5870 }
5871}
5872#[doc = "id: 7"]
5873#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5874#[derive(Debug, Clone, PartialEq)]
5875#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5877pub struct AUTH_KEY_DATA {
5878 #[doc = "key"]
5879 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5880 pub key: [u8; 32],
5881}
5882impl AUTH_KEY_DATA {
5883 pub const ENCODED_LEN: usize = 32usize;
5884 pub const DEFAULT: Self = Self {
5885 key: [0_u8; 32usize],
5886 };
5887 #[cfg(feature = "arbitrary")]
5888 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5889 use arbitrary::{Arbitrary, Unstructured};
5890 let mut buf = [0u8; 1024];
5891 rng.fill_bytes(&mut buf);
5892 let mut unstructured = Unstructured::new(&buf);
5893 Self::arbitrary(&mut unstructured).unwrap_or_default()
5894 }
5895}
5896impl Default for AUTH_KEY_DATA {
5897 fn default() -> Self {
5898 Self::DEFAULT.clone()
5899 }
5900}
5901impl MessageData for AUTH_KEY_DATA {
5902 type Message = MavMessage;
5903 const ID: u32 = 7u32;
5904 const NAME: &'static str = "AUTH_KEY";
5905 const EXTRA_CRC: u8 = 119u8;
5906 const ENCODED_LEN: usize = 32usize;
5907 fn deser(
5908 _version: MavlinkVersion,
5909 __input: &[u8],
5910 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5911 let avail_len = __input.len();
5912 let mut payload_buf = [0; Self::ENCODED_LEN];
5913 let mut buf = if avail_len < Self::ENCODED_LEN {
5914 payload_buf[0..avail_len].copy_from_slice(__input);
5915 Bytes::new(&payload_buf)
5916 } else {
5917 Bytes::new(__input)
5918 };
5919 let mut __struct = Self::default();
5920 for v in &mut __struct.key {
5921 let val = buf.get_u8();
5922 *v = val;
5923 }
5924 Ok(__struct)
5925 }
5926 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5927 let mut __tmp = BytesMut::new(bytes);
5928 #[allow(clippy::absurd_extreme_comparisons)]
5929 #[allow(unused_comparisons)]
5930 if __tmp.remaining() < Self::ENCODED_LEN {
5931 panic!(
5932 "buffer is too small (need {} bytes, but got {})",
5933 Self::ENCODED_LEN,
5934 __tmp.remaining(),
5935 )
5936 }
5937 for val in &self.key {
5938 __tmp.put_u8(*val);
5939 }
5940 if matches!(version, MavlinkVersion::V2) {
5941 let len = __tmp.len();
5942 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5943 } else {
5944 __tmp.len()
5945 }
5946 }
5947}
5948#[doc = "id: 286"]
5949#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5950#[derive(Debug, Clone, PartialEq)]
5951#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5952#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5953pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5954 #[doc = "Timestamp (time since system boot)."]
5955 pub time_boot_us: u64,
5956 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5957 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5958 pub q: [f32; 4],
5959 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5960 pub q_estimated_delay_us: u32,
5961 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5962 pub vx: f32,
5963 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5964 pub vy: f32,
5965 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5966 pub vz: f32,
5967 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5968 pub v_estimated_delay_us: u32,
5969 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5970 pub feed_forward_angular_velocity_z: f32,
5971 #[doc = "Bitmap indicating which estimator outputs are valid."]
5972 pub estimator_status: EstimatorStatusFlags,
5973 #[doc = "System ID"]
5974 pub target_system: u8,
5975 #[doc = "Component ID"]
5976 pub target_component: u8,
5977 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5978 pub landed_state: MavLandedState,
5979 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5980 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5981 pub angular_velocity_z: f32,
5982}
5983impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5984 pub const ENCODED_LEN: usize = 57usize;
5985 pub const DEFAULT: Self = Self {
5986 time_boot_us: 0_u64,
5987 q: [0.0_f32; 4usize],
5988 q_estimated_delay_us: 0_u32,
5989 vx: 0.0_f32,
5990 vy: 0.0_f32,
5991 vz: 0.0_f32,
5992 v_estimated_delay_us: 0_u32,
5993 feed_forward_angular_velocity_z: 0.0_f32,
5994 estimator_status: EstimatorStatusFlags::DEFAULT,
5995 target_system: 0_u8,
5996 target_component: 0_u8,
5997 landed_state: MavLandedState::DEFAULT,
5998 angular_velocity_z: 0.0_f32,
5999 };
6000 #[cfg(feature = "arbitrary")]
6001 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6002 use arbitrary::{Arbitrary, Unstructured};
6003 let mut buf = [0u8; 1024];
6004 rng.fill_bytes(&mut buf);
6005 let mut unstructured = Unstructured::new(&buf);
6006 Self::arbitrary(&mut unstructured).unwrap_or_default()
6007 }
6008}
6009impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6010 fn default() -> Self {
6011 Self::DEFAULT.clone()
6012 }
6013}
6014impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6015 type Message = MavMessage;
6016 const ID: u32 = 286u32;
6017 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6018 const EXTRA_CRC: u8 = 210u8;
6019 const ENCODED_LEN: usize = 57usize;
6020 fn deser(
6021 _version: MavlinkVersion,
6022 __input: &[u8],
6023 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6024 let avail_len = __input.len();
6025 let mut payload_buf = [0; Self::ENCODED_LEN];
6026 let mut buf = if avail_len < Self::ENCODED_LEN {
6027 payload_buf[0..avail_len].copy_from_slice(__input);
6028 Bytes::new(&payload_buf)
6029 } else {
6030 Bytes::new(__input)
6031 };
6032 let mut __struct = Self::default();
6033 __struct.time_boot_us = buf.get_u64_le();
6034 for v in &mut __struct.q {
6035 let val = buf.get_f32_le();
6036 *v = val;
6037 }
6038 __struct.q_estimated_delay_us = buf.get_u32_le();
6039 __struct.vx = buf.get_f32_le();
6040 __struct.vy = buf.get_f32_le();
6041 __struct.vz = buf.get_f32_le();
6042 __struct.v_estimated_delay_us = buf.get_u32_le();
6043 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6044 let tmp = buf.get_u16_le();
6045 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6046 tmp & EstimatorStatusFlags::all().bits(),
6047 )
6048 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6049 flag_type: "EstimatorStatusFlags",
6050 value: tmp as u32,
6051 })?;
6052 __struct.target_system = buf.get_u8();
6053 __struct.target_component = buf.get_u8();
6054 let tmp = buf.get_u8();
6055 __struct.landed_state =
6056 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6057 enum_type: "MavLandedState",
6058 value: tmp as u32,
6059 })?;
6060 __struct.angular_velocity_z = buf.get_f32_le();
6061 Ok(__struct)
6062 }
6063 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6064 let mut __tmp = BytesMut::new(bytes);
6065 #[allow(clippy::absurd_extreme_comparisons)]
6066 #[allow(unused_comparisons)]
6067 if __tmp.remaining() < Self::ENCODED_LEN {
6068 panic!(
6069 "buffer is too small (need {} bytes, but got {})",
6070 Self::ENCODED_LEN,
6071 __tmp.remaining(),
6072 )
6073 }
6074 __tmp.put_u64_le(self.time_boot_us);
6075 for val in &self.q {
6076 __tmp.put_f32_le(*val);
6077 }
6078 __tmp.put_u32_le(self.q_estimated_delay_us);
6079 __tmp.put_f32_le(self.vx);
6080 __tmp.put_f32_le(self.vy);
6081 __tmp.put_f32_le(self.vz);
6082 __tmp.put_u32_le(self.v_estimated_delay_us);
6083 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6084 __tmp.put_u16_le(self.estimator_status.bits());
6085 __tmp.put_u8(self.target_system);
6086 __tmp.put_u8(self.target_component);
6087 __tmp.put_u8(self.landed_state as u8);
6088 __tmp.put_f32_le(self.angular_velocity_z);
6089 if matches!(version, MavlinkVersion::V2) {
6090 let len = __tmp.len();
6091 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6092 } else {
6093 __tmp.len()
6094 }
6095 }
6096}
6097#[doc = "id: 148"]
6098#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6099#[derive(Debug, Clone, PartialEq)]
6100#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6102pub struct AUTOPILOT_VERSION_DATA {
6103 #[doc = "Bitmap of capabilities"]
6104 pub capabilities: MavProtocolCapability,
6105 #[doc = "UID if provided by hardware (see uid2)"]
6106 pub uid: u64,
6107 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6108 pub flight_sw_version: u32,
6109 #[doc = "Middleware version number"]
6110 pub middleware_sw_version: u32,
6111 #[doc = "Operating system version number"]
6112 pub os_sw_version: u32,
6113 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6114 pub board_version: u32,
6115 #[doc = "ID of the board vendor"]
6116 pub vendor_id: u16,
6117 #[doc = "ID of the product"]
6118 pub product_id: u16,
6119 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6120 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6121 pub flight_custom_version: [u8; 8],
6122 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6123 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6124 pub middleware_custom_version: [u8; 8],
6125 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6126 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6127 pub os_custom_version: [u8; 8],
6128 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6129 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6130 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6131 pub uid2: [u8; 18],
6132}
6133impl AUTOPILOT_VERSION_DATA {
6134 pub const ENCODED_LEN: usize = 78usize;
6135 pub const DEFAULT: Self = Self {
6136 capabilities: MavProtocolCapability::DEFAULT,
6137 uid: 0_u64,
6138 flight_sw_version: 0_u32,
6139 middleware_sw_version: 0_u32,
6140 os_sw_version: 0_u32,
6141 board_version: 0_u32,
6142 vendor_id: 0_u16,
6143 product_id: 0_u16,
6144 flight_custom_version: [0_u8; 8usize],
6145 middleware_custom_version: [0_u8; 8usize],
6146 os_custom_version: [0_u8; 8usize],
6147 uid2: [0_u8; 18usize],
6148 };
6149 #[cfg(feature = "arbitrary")]
6150 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6151 use arbitrary::{Arbitrary, Unstructured};
6152 let mut buf = [0u8; 1024];
6153 rng.fill_bytes(&mut buf);
6154 let mut unstructured = Unstructured::new(&buf);
6155 Self::arbitrary(&mut unstructured).unwrap_or_default()
6156 }
6157}
6158impl Default for AUTOPILOT_VERSION_DATA {
6159 fn default() -> Self {
6160 Self::DEFAULT.clone()
6161 }
6162}
6163impl MessageData for AUTOPILOT_VERSION_DATA {
6164 type Message = MavMessage;
6165 const ID: u32 = 148u32;
6166 const NAME: &'static str = "AUTOPILOT_VERSION";
6167 const EXTRA_CRC: u8 = 178u8;
6168 const ENCODED_LEN: usize = 78usize;
6169 fn deser(
6170 _version: MavlinkVersion,
6171 __input: &[u8],
6172 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6173 let avail_len = __input.len();
6174 let mut payload_buf = [0; Self::ENCODED_LEN];
6175 let mut buf = if avail_len < Self::ENCODED_LEN {
6176 payload_buf[0..avail_len].copy_from_slice(__input);
6177 Bytes::new(&payload_buf)
6178 } else {
6179 Bytes::new(__input)
6180 };
6181 let mut __struct = Self::default();
6182 let tmp = buf.get_u64_le();
6183 __struct.capabilities = MavProtocolCapability::from_bits(
6184 tmp & MavProtocolCapability::all().bits(),
6185 )
6186 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6187 flag_type: "MavProtocolCapability",
6188 value: tmp as u32,
6189 })?;
6190 __struct.uid = buf.get_u64_le();
6191 __struct.flight_sw_version = buf.get_u32_le();
6192 __struct.middleware_sw_version = buf.get_u32_le();
6193 __struct.os_sw_version = buf.get_u32_le();
6194 __struct.board_version = buf.get_u32_le();
6195 __struct.vendor_id = buf.get_u16_le();
6196 __struct.product_id = buf.get_u16_le();
6197 for v in &mut __struct.flight_custom_version {
6198 let val = buf.get_u8();
6199 *v = val;
6200 }
6201 for v in &mut __struct.middleware_custom_version {
6202 let val = buf.get_u8();
6203 *v = val;
6204 }
6205 for v in &mut __struct.os_custom_version {
6206 let val = buf.get_u8();
6207 *v = val;
6208 }
6209 for v in &mut __struct.uid2 {
6210 let val = buf.get_u8();
6211 *v = val;
6212 }
6213 Ok(__struct)
6214 }
6215 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6216 let mut __tmp = BytesMut::new(bytes);
6217 #[allow(clippy::absurd_extreme_comparisons)]
6218 #[allow(unused_comparisons)]
6219 if __tmp.remaining() < Self::ENCODED_LEN {
6220 panic!(
6221 "buffer is too small (need {} bytes, but got {})",
6222 Self::ENCODED_LEN,
6223 __tmp.remaining(),
6224 )
6225 }
6226 __tmp.put_u64_le(self.capabilities.bits());
6227 __tmp.put_u64_le(self.uid);
6228 __tmp.put_u32_le(self.flight_sw_version);
6229 __tmp.put_u32_le(self.middleware_sw_version);
6230 __tmp.put_u32_le(self.os_sw_version);
6231 __tmp.put_u32_le(self.board_version);
6232 __tmp.put_u16_le(self.vendor_id);
6233 __tmp.put_u16_le(self.product_id);
6234 for val in &self.flight_custom_version {
6235 __tmp.put_u8(*val);
6236 }
6237 for val in &self.middleware_custom_version {
6238 __tmp.put_u8(*val);
6239 }
6240 for val in &self.os_custom_version {
6241 __tmp.put_u8(*val);
6242 }
6243 for val in &self.uid2 {
6244 __tmp.put_u8(*val);
6245 }
6246 if matches!(version, MavlinkVersion::V2) {
6247 let len = __tmp.len();
6248 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6249 } else {
6250 __tmp.len()
6251 }
6252 }
6253}
6254#[doc = "id: 435"]
6255#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6256#[derive(Debug, Clone, PartialEq)]
6257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6258#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6259pub struct AVAILABLE_MODES_DATA {
6260 #[doc = "A bitfield for use for autopilot-specific flags"]
6261 pub custom_mode: u32,
6262 #[doc = "Mode properties."]
6263 pub properties: MavModeProperty,
6264 #[doc = "The total number of available modes for the current vehicle type."]
6265 pub number_modes: u8,
6266 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6267 pub mode_index: u8,
6268 #[doc = "Standard mode."]
6269 pub standard_mode: MavStandardMode,
6270 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6271 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6272 pub mode_name: [u8; 35],
6273}
6274impl AVAILABLE_MODES_DATA {
6275 pub const ENCODED_LEN: usize = 46usize;
6276 pub const DEFAULT: Self = Self {
6277 custom_mode: 0_u32,
6278 properties: MavModeProperty::DEFAULT,
6279 number_modes: 0_u8,
6280 mode_index: 0_u8,
6281 standard_mode: MavStandardMode::DEFAULT,
6282 mode_name: [0_u8; 35usize],
6283 };
6284 #[cfg(feature = "arbitrary")]
6285 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6286 use arbitrary::{Arbitrary, Unstructured};
6287 let mut buf = [0u8; 1024];
6288 rng.fill_bytes(&mut buf);
6289 let mut unstructured = Unstructured::new(&buf);
6290 Self::arbitrary(&mut unstructured).unwrap_or_default()
6291 }
6292}
6293impl Default for AVAILABLE_MODES_DATA {
6294 fn default() -> Self {
6295 Self::DEFAULT.clone()
6296 }
6297}
6298impl MessageData for AVAILABLE_MODES_DATA {
6299 type Message = MavMessage;
6300 const ID: u32 = 435u32;
6301 const NAME: &'static str = "AVAILABLE_MODES";
6302 const EXTRA_CRC: u8 = 134u8;
6303 const ENCODED_LEN: usize = 46usize;
6304 fn deser(
6305 _version: MavlinkVersion,
6306 __input: &[u8],
6307 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6308 let avail_len = __input.len();
6309 let mut payload_buf = [0; Self::ENCODED_LEN];
6310 let mut buf = if avail_len < Self::ENCODED_LEN {
6311 payload_buf[0..avail_len].copy_from_slice(__input);
6312 Bytes::new(&payload_buf)
6313 } else {
6314 Bytes::new(__input)
6315 };
6316 let mut __struct = Self::default();
6317 __struct.custom_mode = buf.get_u32_le();
6318 let tmp = buf.get_u32_le();
6319 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6320 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6321 flag_type: "MavModeProperty",
6322 value: tmp as u32,
6323 })?;
6324 __struct.number_modes = buf.get_u8();
6325 __struct.mode_index = buf.get_u8();
6326 let tmp = buf.get_u8();
6327 __struct.standard_mode =
6328 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6329 enum_type: "MavStandardMode",
6330 value: tmp as u32,
6331 })?;
6332 for v in &mut __struct.mode_name {
6333 let val = buf.get_u8();
6334 *v = val;
6335 }
6336 Ok(__struct)
6337 }
6338 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6339 let mut __tmp = BytesMut::new(bytes);
6340 #[allow(clippy::absurd_extreme_comparisons)]
6341 #[allow(unused_comparisons)]
6342 if __tmp.remaining() < Self::ENCODED_LEN {
6343 panic!(
6344 "buffer is too small (need {} bytes, but got {})",
6345 Self::ENCODED_LEN,
6346 __tmp.remaining(),
6347 )
6348 }
6349 __tmp.put_u32_le(self.custom_mode);
6350 __tmp.put_u32_le(self.properties.bits());
6351 __tmp.put_u8(self.number_modes);
6352 __tmp.put_u8(self.mode_index);
6353 __tmp.put_u8(self.standard_mode as u8);
6354 for val in &self.mode_name {
6355 __tmp.put_u8(*val);
6356 }
6357 if matches!(version, MavlinkVersion::V2) {
6358 let len = __tmp.len();
6359 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6360 } else {
6361 __tmp.len()
6362 }
6363 }
6364}
6365#[doc = "id: 437"]
6366#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6367#[derive(Debug, Clone, PartialEq)]
6368#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6369#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6370pub struct AVAILABLE_MODES_MONITOR_DATA {
6371 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6372 pub seq: u8,
6373}
6374impl AVAILABLE_MODES_MONITOR_DATA {
6375 pub const ENCODED_LEN: usize = 1usize;
6376 pub const DEFAULT: Self = Self { seq: 0_u8 };
6377 #[cfg(feature = "arbitrary")]
6378 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6379 use arbitrary::{Arbitrary, Unstructured};
6380 let mut buf = [0u8; 1024];
6381 rng.fill_bytes(&mut buf);
6382 let mut unstructured = Unstructured::new(&buf);
6383 Self::arbitrary(&mut unstructured).unwrap_or_default()
6384 }
6385}
6386impl Default for AVAILABLE_MODES_MONITOR_DATA {
6387 fn default() -> Self {
6388 Self::DEFAULT.clone()
6389 }
6390}
6391impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6392 type Message = MavMessage;
6393 const ID: u32 = 437u32;
6394 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6395 const EXTRA_CRC: u8 = 30u8;
6396 const ENCODED_LEN: usize = 1usize;
6397 fn deser(
6398 _version: MavlinkVersion,
6399 __input: &[u8],
6400 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6401 let avail_len = __input.len();
6402 let mut payload_buf = [0; Self::ENCODED_LEN];
6403 let mut buf = if avail_len < Self::ENCODED_LEN {
6404 payload_buf[0..avail_len].copy_from_slice(__input);
6405 Bytes::new(&payload_buf)
6406 } else {
6407 Bytes::new(__input)
6408 };
6409 let mut __struct = Self::default();
6410 __struct.seq = buf.get_u8();
6411 Ok(__struct)
6412 }
6413 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6414 let mut __tmp = BytesMut::new(bytes);
6415 #[allow(clippy::absurd_extreme_comparisons)]
6416 #[allow(unused_comparisons)]
6417 if __tmp.remaining() < Self::ENCODED_LEN {
6418 panic!(
6419 "buffer is too small (need {} bytes, but got {})",
6420 Self::ENCODED_LEN,
6421 __tmp.remaining(),
6422 )
6423 }
6424 __tmp.put_u8(self.seq);
6425 if matches!(version, MavlinkVersion::V2) {
6426 let len = __tmp.len();
6427 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6428 } else {
6429 __tmp.len()
6430 }
6431 }
6432}
6433#[doc = "id: 372"]
6434#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6435#[derive(Debug, Clone, PartialEq)]
6436#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6437#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6438pub struct BATTERY_INFO_DATA {
6439 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6440 pub discharge_minimum_voltage: f32,
6441 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6442 pub charging_minimum_voltage: f32,
6443 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6444 pub resting_minimum_voltage: f32,
6445 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6446 pub charging_maximum_voltage: f32,
6447 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6448 pub charging_maximum_current: f32,
6449 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6450 pub nominal_voltage: f32,
6451 #[doc = "Maximum pack discharge current. 0: field not provided."]
6452 pub discharge_maximum_current: f32,
6453 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6454 pub discharge_maximum_burst_current: f32,
6455 #[doc = "Fully charged design capacity. 0: field not provided."]
6456 pub design_capacity: f32,
6457 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6458 pub full_charge_capacity: f32,
6459 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6460 pub cycle_count: u16,
6461 #[doc = "Battery weight. 0: field not provided."]
6462 pub weight: u16,
6463 #[doc = "Battery ID"]
6464 pub id: u8,
6465 #[doc = "Function of the battery."]
6466 pub battery_function: MavBatteryFunction,
6467 #[doc = "Type (chemistry) of the battery."]
6468 pub mavtype: MavBatteryType,
6469 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6470 pub state_of_health: u8,
6471 #[doc = "Number of battery cells in series. 0: field not provided."]
6472 pub cells_in_series: u8,
6473 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6474 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6475 pub manufacture_date: [u8; 9],
6476 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6477 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6478 pub serial_number: [u8; 32],
6479 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6480 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6481 pub name: [u8; 50],
6482}
6483impl BATTERY_INFO_DATA {
6484 pub const ENCODED_LEN: usize = 140usize;
6485 pub const DEFAULT: Self = Self {
6486 discharge_minimum_voltage: 0.0_f32,
6487 charging_minimum_voltage: 0.0_f32,
6488 resting_minimum_voltage: 0.0_f32,
6489 charging_maximum_voltage: 0.0_f32,
6490 charging_maximum_current: 0.0_f32,
6491 nominal_voltage: 0.0_f32,
6492 discharge_maximum_current: 0.0_f32,
6493 discharge_maximum_burst_current: 0.0_f32,
6494 design_capacity: 0.0_f32,
6495 full_charge_capacity: 0.0_f32,
6496 cycle_count: 0_u16,
6497 weight: 0_u16,
6498 id: 0_u8,
6499 battery_function: MavBatteryFunction::DEFAULT,
6500 mavtype: MavBatteryType::DEFAULT,
6501 state_of_health: 0_u8,
6502 cells_in_series: 0_u8,
6503 manufacture_date: [0_u8; 9usize],
6504 serial_number: [0_u8; 32usize],
6505 name: [0_u8; 50usize],
6506 };
6507 #[cfg(feature = "arbitrary")]
6508 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6509 use arbitrary::{Arbitrary, Unstructured};
6510 let mut buf = [0u8; 1024];
6511 rng.fill_bytes(&mut buf);
6512 let mut unstructured = Unstructured::new(&buf);
6513 Self::arbitrary(&mut unstructured).unwrap_or_default()
6514 }
6515}
6516impl Default for BATTERY_INFO_DATA {
6517 fn default() -> Self {
6518 Self::DEFAULT.clone()
6519 }
6520}
6521impl MessageData for BATTERY_INFO_DATA {
6522 type Message = MavMessage;
6523 const ID: u32 = 372u32;
6524 const NAME: &'static str = "BATTERY_INFO";
6525 const EXTRA_CRC: u8 = 26u8;
6526 const ENCODED_LEN: usize = 140usize;
6527 fn deser(
6528 _version: MavlinkVersion,
6529 __input: &[u8],
6530 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6531 let avail_len = __input.len();
6532 let mut payload_buf = [0; Self::ENCODED_LEN];
6533 let mut buf = if avail_len < Self::ENCODED_LEN {
6534 payload_buf[0..avail_len].copy_from_slice(__input);
6535 Bytes::new(&payload_buf)
6536 } else {
6537 Bytes::new(__input)
6538 };
6539 let mut __struct = Self::default();
6540 __struct.discharge_minimum_voltage = buf.get_f32_le();
6541 __struct.charging_minimum_voltage = buf.get_f32_le();
6542 __struct.resting_minimum_voltage = buf.get_f32_le();
6543 __struct.charging_maximum_voltage = buf.get_f32_le();
6544 __struct.charging_maximum_current = buf.get_f32_le();
6545 __struct.nominal_voltage = buf.get_f32_le();
6546 __struct.discharge_maximum_current = buf.get_f32_le();
6547 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6548 __struct.design_capacity = buf.get_f32_le();
6549 __struct.full_charge_capacity = buf.get_f32_le();
6550 __struct.cycle_count = buf.get_u16_le();
6551 __struct.weight = buf.get_u16_le();
6552 __struct.id = buf.get_u8();
6553 let tmp = buf.get_u8();
6554 __struct.battery_function =
6555 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6556 enum_type: "MavBatteryFunction",
6557 value: tmp as u32,
6558 })?;
6559 let tmp = buf.get_u8();
6560 __struct.mavtype =
6561 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6562 enum_type: "MavBatteryType",
6563 value: tmp as u32,
6564 })?;
6565 __struct.state_of_health = buf.get_u8();
6566 __struct.cells_in_series = buf.get_u8();
6567 for v in &mut __struct.manufacture_date {
6568 let val = buf.get_u8();
6569 *v = val;
6570 }
6571 for v in &mut __struct.serial_number {
6572 let val = buf.get_u8();
6573 *v = val;
6574 }
6575 for v in &mut __struct.name {
6576 let val = buf.get_u8();
6577 *v = val;
6578 }
6579 Ok(__struct)
6580 }
6581 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6582 let mut __tmp = BytesMut::new(bytes);
6583 #[allow(clippy::absurd_extreme_comparisons)]
6584 #[allow(unused_comparisons)]
6585 if __tmp.remaining() < Self::ENCODED_LEN {
6586 panic!(
6587 "buffer is too small (need {} bytes, but got {})",
6588 Self::ENCODED_LEN,
6589 __tmp.remaining(),
6590 )
6591 }
6592 __tmp.put_f32_le(self.discharge_minimum_voltage);
6593 __tmp.put_f32_le(self.charging_minimum_voltage);
6594 __tmp.put_f32_le(self.resting_minimum_voltage);
6595 __tmp.put_f32_le(self.charging_maximum_voltage);
6596 __tmp.put_f32_le(self.charging_maximum_current);
6597 __tmp.put_f32_le(self.nominal_voltage);
6598 __tmp.put_f32_le(self.discharge_maximum_current);
6599 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6600 __tmp.put_f32_le(self.design_capacity);
6601 __tmp.put_f32_le(self.full_charge_capacity);
6602 __tmp.put_u16_le(self.cycle_count);
6603 __tmp.put_u16_le(self.weight);
6604 __tmp.put_u8(self.id);
6605 __tmp.put_u8(self.battery_function as u8);
6606 __tmp.put_u8(self.mavtype as u8);
6607 __tmp.put_u8(self.state_of_health);
6608 __tmp.put_u8(self.cells_in_series);
6609 for val in &self.manufacture_date {
6610 __tmp.put_u8(*val);
6611 }
6612 for val in &self.serial_number {
6613 __tmp.put_u8(*val);
6614 }
6615 for val in &self.name {
6616 __tmp.put_u8(*val);
6617 }
6618 if matches!(version, MavlinkVersion::V2) {
6619 let len = __tmp.len();
6620 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6621 } else {
6622 __tmp.len()
6623 }
6624 }
6625}
6626#[doc = "id: 147"]
6627#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6628#[derive(Debug, Clone, PartialEq)]
6629#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6630#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6631pub struct BATTERY_STATUS_DATA {
6632 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6633 pub current_consumed: i32,
6634 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6635 pub energy_consumed: i32,
6636 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6637 pub temperature: i16,
6638 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6639 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6640 pub voltages: [u16; 10],
6641 #[doc = "Battery current, -1: autopilot does not measure the current"]
6642 pub current_battery: i16,
6643 #[doc = "Battery ID"]
6644 pub id: u8,
6645 #[doc = "Function of the battery"]
6646 pub battery_function: MavBatteryFunction,
6647 #[doc = "Type (chemistry) of the battery"]
6648 pub mavtype: MavBatteryType,
6649 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6650 pub battery_remaining: i8,
6651 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6652 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6653 pub time_remaining: i32,
6654 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6655 #[cfg_attr(feature = "serde", serde(default))]
6656 pub charge_state: MavBatteryChargeState,
6657 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6658 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6659 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6660 pub voltages_ext: [u16; 4],
6661 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6662 #[cfg_attr(feature = "serde", serde(default))]
6663 pub mode: MavBatteryMode,
6664 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6665 #[cfg_attr(feature = "serde", serde(default))]
6666 pub fault_bitmask: MavBatteryFault,
6667}
6668impl BATTERY_STATUS_DATA {
6669 pub const ENCODED_LEN: usize = 54usize;
6670 pub const DEFAULT: Self = Self {
6671 current_consumed: 0_i32,
6672 energy_consumed: 0_i32,
6673 temperature: 0_i16,
6674 voltages: [0_u16; 10usize],
6675 current_battery: 0_i16,
6676 id: 0_u8,
6677 battery_function: MavBatteryFunction::DEFAULT,
6678 mavtype: MavBatteryType::DEFAULT,
6679 battery_remaining: 0_i8,
6680 time_remaining: 0_i32,
6681 charge_state: MavBatteryChargeState::DEFAULT,
6682 voltages_ext: [0_u16; 4usize],
6683 mode: MavBatteryMode::DEFAULT,
6684 fault_bitmask: MavBatteryFault::DEFAULT,
6685 };
6686 #[cfg(feature = "arbitrary")]
6687 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6688 use arbitrary::{Arbitrary, Unstructured};
6689 let mut buf = [0u8; 1024];
6690 rng.fill_bytes(&mut buf);
6691 let mut unstructured = Unstructured::new(&buf);
6692 Self::arbitrary(&mut unstructured).unwrap_or_default()
6693 }
6694}
6695impl Default for BATTERY_STATUS_DATA {
6696 fn default() -> Self {
6697 Self::DEFAULT.clone()
6698 }
6699}
6700impl MessageData for BATTERY_STATUS_DATA {
6701 type Message = MavMessage;
6702 const ID: u32 = 147u32;
6703 const NAME: &'static str = "BATTERY_STATUS";
6704 const EXTRA_CRC: u8 = 154u8;
6705 const ENCODED_LEN: usize = 54usize;
6706 fn deser(
6707 _version: MavlinkVersion,
6708 __input: &[u8],
6709 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6710 let avail_len = __input.len();
6711 let mut payload_buf = [0; Self::ENCODED_LEN];
6712 let mut buf = if avail_len < Self::ENCODED_LEN {
6713 payload_buf[0..avail_len].copy_from_slice(__input);
6714 Bytes::new(&payload_buf)
6715 } else {
6716 Bytes::new(__input)
6717 };
6718 let mut __struct = Self::default();
6719 __struct.current_consumed = buf.get_i32_le();
6720 __struct.energy_consumed = buf.get_i32_le();
6721 __struct.temperature = buf.get_i16_le();
6722 for v in &mut __struct.voltages {
6723 let val = buf.get_u16_le();
6724 *v = val;
6725 }
6726 __struct.current_battery = buf.get_i16_le();
6727 __struct.id = buf.get_u8();
6728 let tmp = buf.get_u8();
6729 __struct.battery_function =
6730 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6731 enum_type: "MavBatteryFunction",
6732 value: tmp as u32,
6733 })?;
6734 let tmp = buf.get_u8();
6735 __struct.mavtype =
6736 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6737 enum_type: "MavBatteryType",
6738 value: tmp as u32,
6739 })?;
6740 __struct.battery_remaining = buf.get_i8();
6741 __struct.time_remaining = buf.get_i32_le();
6742 let tmp = buf.get_u8();
6743 __struct.charge_state =
6744 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6745 enum_type: "MavBatteryChargeState",
6746 value: tmp as u32,
6747 })?;
6748 for v in &mut __struct.voltages_ext {
6749 let val = buf.get_u16_le();
6750 *v = val;
6751 }
6752 let tmp = buf.get_u8();
6753 __struct.mode =
6754 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6755 enum_type: "MavBatteryMode",
6756 value: tmp as u32,
6757 })?;
6758 let tmp = buf.get_u32_le();
6759 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6760 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6761 flag_type: "MavBatteryFault",
6762 value: tmp as u32,
6763 })?;
6764 Ok(__struct)
6765 }
6766 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6767 let mut __tmp = BytesMut::new(bytes);
6768 #[allow(clippy::absurd_extreme_comparisons)]
6769 #[allow(unused_comparisons)]
6770 if __tmp.remaining() < Self::ENCODED_LEN {
6771 panic!(
6772 "buffer is too small (need {} bytes, but got {})",
6773 Self::ENCODED_LEN,
6774 __tmp.remaining(),
6775 )
6776 }
6777 __tmp.put_i32_le(self.current_consumed);
6778 __tmp.put_i32_le(self.energy_consumed);
6779 __tmp.put_i16_le(self.temperature);
6780 for val in &self.voltages {
6781 __tmp.put_u16_le(*val);
6782 }
6783 __tmp.put_i16_le(self.current_battery);
6784 __tmp.put_u8(self.id);
6785 __tmp.put_u8(self.battery_function as u8);
6786 __tmp.put_u8(self.mavtype as u8);
6787 __tmp.put_i8(self.battery_remaining);
6788 __tmp.put_i32_le(self.time_remaining);
6789 __tmp.put_u8(self.charge_state as u8);
6790 for val in &self.voltages_ext {
6791 __tmp.put_u16_le(*val);
6792 }
6793 __tmp.put_u8(self.mode as u8);
6794 __tmp.put_u32_le(self.fault_bitmask.bits());
6795 if matches!(version, MavlinkVersion::V2) {
6796 let len = __tmp.len();
6797 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6798 } else {
6799 __tmp.len()
6800 }
6801 }
6802}
6803#[doc = "id: 369"]
6804#[doc = "Battery dynamic information. This should be streamed (nominally at 1Hz). Static/invariant battery information is sent in BATTERY_INFO. Note that smart batteries should set the MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL bit to indicate that supplied capacity values are relative to a battery that is known to be full. Power monitors would not set this bit, indicating that capacity_consumed is relative to drone power-on, and that other values are estimated based on the assumption that the battery was full on power-on."]
6805#[derive(Debug, Clone, PartialEq)]
6806#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6807#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6808pub struct BATTERY_STATUS_V2_DATA {
6809 #[doc = "Battery voltage (total). NaN: field not provided."]
6810 pub voltage: f32,
6811 #[doc = "Battery current (through all cells/loads). Positive value when discharging and negative if charging. NaN: field not provided."]
6812 pub current: f32,
6813 #[doc = "Consumed charge. NaN: field not provided. This is either the consumption since power-on or since the battery was full, depending on the value of MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL."]
6814 pub capacity_consumed: f32,
6815 #[doc = "Remaining charge (until empty). NaN: field not provided. Note: If MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL is unset, this value is based on the assumption the battery was full when the system was powered."]
6816 pub capacity_remaining: f32,
6817 #[doc = "Fault, health, readiness, and other status indications."]
6818 pub status_flags: MavBatteryStatusFlags,
6819 #[doc = "Temperature of the whole battery pack (not internal electronics). INT16_MAX field not provided."]
6820 pub temperature: i16,
6821 #[doc = "Battery ID"]
6822 pub id: u8,
6823 #[doc = "Remaining battery energy. Values: [0-100], UINT8_MAX: field not provided."]
6824 pub percent_remaining: u8,
6825}
6826impl BATTERY_STATUS_V2_DATA {
6827 pub const ENCODED_LEN: usize = 24usize;
6828 pub const DEFAULT: Self = Self {
6829 voltage: 0.0_f32,
6830 current: 0.0_f32,
6831 capacity_consumed: 0.0_f32,
6832 capacity_remaining: 0.0_f32,
6833 status_flags: MavBatteryStatusFlags::DEFAULT,
6834 temperature: 0_i16,
6835 id: 0_u8,
6836 percent_remaining: 0_u8,
6837 };
6838 #[cfg(feature = "arbitrary")]
6839 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6840 use arbitrary::{Arbitrary, Unstructured};
6841 let mut buf = [0u8; 1024];
6842 rng.fill_bytes(&mut buf);
6843 let mut unstructured = Unstructured::new(&buf);
6844 Self::arbitrary(&mut unstructured).unwrap_or_default()
6845 }
6846}
6847impl Default for BATTERY_STATUS_V2_DATA {
6848 fn default() -> Self {
6849 Self::DEFAULT.clone()
6850 }
6851}
6852impl MessageData for BATTERY_STATUS_V2_DATA {
6853 type Message = MavMessage;
6854 const ID: u32 = 369u32;
6855 const NAME: &'static str = "BATTERY_STATUS_V2";
6856 const EXTRA_CRC: u8 = 151u8;
6857 const ENCODED_LEN: usize = 24usize;
6858 fn deser(
6859 _version: MavlinkVersion,
6860 __input: &[u8],
6861 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6862 let avail_len = __input.len();
6863 let mut payload_buf = [0; Self::ENCODED_LEN];
6864 let mut buf = if avail_len < Self::ENCODED_LEN {
6865 payload_buf[0..avail_len].copy_from_slice(__input);
6866 Bytes::new(&payload_buf)
6867 } else {
6868 Bytes::new(__input)
6869 };
6870 let mut __struct = Self::default();
6871 __struct.voltage = buf.get_f32_le();
6872 __struct.current = buf.get_f32_le();
6873 __struct.capacity_consumed = buf.get_f32_le();
6874 __struct.capacity_remaining = buf.get_f32_le();
6875 let tmp = buf.get_u32_le();
6876 __struct.status_flags = MavBatteryStatusFlags::from_bits(
6877 tmp & MavBatteryStatusFlags::all().bits(),
6878 )
6879 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6880 flag_type: "MavBatteryStatusFlags",
6881 value: tmp as u32,
6882 })?;
6883 __struct.temperature = buf.get_i16_le();
6884 __struct.id = buf.get_u8();
6885 __struct.percent_remaining = buf.get_u8();
6886 Ok(__struct)
6887 }
6888 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6889 let mut __tmp = BytesMut::new(bytes);
6890 #[allow(clippy::absurd_extreme_comparisons)]
6891 #[allow(unused_comparisons)]
6892 if __tmp.remaining() < Self::ENCODED_LEN {
6893 panic!(
6894 "buffer is too small (need {} bytes, but got {})",
6895 Self::ENCODED_LEN,
6896 __tmp.remaining(),
6897 )
6898 }
6899 __tmp.put_f32_le(self.voltage);
6900 __tmp.put_f32_le(self.current);
6901 __tmp.put_f32_le(self.capacity_consumed);
6902 __tmp.put_f32_le(self.capacity_remaining);
6903 __tmp.put_u32_le(self.status_flags.bits());
6904 __tmp.put_i16_le(self.temperature);
6905 __tmp.put_u8(self.id);
6906 __tmp.put_u8(self.percent_remaining);
6907 if matches!(version, MavlinkVersion::V2) {
6908 let len = __tmp.len();
6909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6910 } else {
6911 __tmp.len()
6912 }
6913 }
6914}
6915#[doc = "id: 257"]
6916#[doc = "Report button state change."]
6917#[derive(Debug, Clone, PartialEq)]
6918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6920pub struct BUTTON_CHANGE_DATA {
6921 #[doc = "Timestamp (time since system boot)."]
6922 pub time_boot_ms: u32,
6923 #[doc = "Time of last change of button state."]
6924 pub last_change_ms: u32,
6925 #[doc = "Bitmap for state of buttons."]
6926 pub state: u8,
6927}
6928impl BUTTON_CHANGE_DATA {
6929 pub const ENCODED_LEN: usize = 9usize;
6930 pub const DEFAULT: Self = Self {
6931 time_boot_ms: 0_u32,
6932 last_change_ms: 0_u32,
6933 state: 0_u8,
6934 };
6935 #[cfg(feature = "arbitrary")]
6936 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6937 use arbitrary::{Arbitrary, Unstructured};
6938 let mut buf = [0u8; 1024];
6939 rng.fill_bytes(&mut buf);
6940 let mut unstructured = Unstructured::new(&buf);
6941 Self::arbitrary(&mut unstructured).unwrap_or_default()
6942 }
6943}
6944impl Default for BUTTON_CHANGE_DATA {
6945 fn default() -> Self {
6946 Self::DEFAULT.clone()
6947 }
6948}
6949impl MessageData for BUTTON_CHANGE_DATA {
6950 type Message = MavMessage;
6951 const ID: u32 = 257u32;
6952 const NAME: &'static str = "BUTTON_CHANGE";
6953 const EXTRA_CRC: u8 = 131u8;
6954 const ENCODED_LEN: usize = 9usize;
6955 fn deser(
6956 _version: MavlinkVersion,
6957 __input: &[u8],
6958 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6959 let avail_len = __input.len();
6960 let mut payload_buf = [0; Self::ENCODED_LEN];
6961 let mut buf = if avail_len < Self::ENCODED_LEN {
6962 payload_buf[0..avail_len].copy_from_slice(__input);
6963 Bytes::new(&payload_buf)
6964 } else {
6965 Bytes::new(__input)
6966 };
6967 let mut __struct = Self::default();
6968 __struct.time_boot_ms = buf.get_u32_le();
6969 __struct.last_change_ms = buf.get_u32_le();
6970 __struct.state = buf.get_u8();
6971 Ok(__struct)
6972 }
6973 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6974 let mut __tmp = BytesMut::new(bytes);
6975 #[allow(clippy::absurd_extreme_comparisons)]
6976 #[allow(unused_comparisons)]
6977 if __tmp.remaining() < Self::ENCODED_LEN {
6978 panic!(
6979 "buffer is too small (need {} bytes, but got {})",
6980 Self::ENCODED_LEN,
6981 __tmp.remaining(),
6982 )
6983 }
6984 __tmp.put_u32_le(self.time_boot_ms);
6985 __tmp.put_u32_le(self.last_change_ms);
6986 __tmp.put_u8(self.state);
6987 if matches!(version, MavlinkVersion::V2) {
6988 let len = __tmp.len();
6989 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6990 } else {
6991 __tmp.len()
6992 }
6993 }
6994}
6995#[doc = "id: 262"]
6996#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6997#[derive(Debug, Clone, PartialEq)]
6998#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6999#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7000pub struct CAMERA_CAPTURE_STATUS_DATA {
7001 #[doc = "Timestamp (time since system boot)."]
7002 pub time_boot_ms: u32,
7003 #[doc = "Image capture interval"]
7004 pub image_interval: f32,
7005 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7006 pub recording_time_ms: u32,
7007 #[doc = "Available storage capacity."]
7008 pub available_capacity: f32,
7009 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7010 pub image_status: u8,
7011 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7012 pub video_status: u8,
7013 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7014 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7015 pub image_count: i32,
7016 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7017 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7018 pub camera_device_id: u8,
7019}
7020impl CAMERA_CAPTURE_STATUS_DATA {
7021 pub const ENCODED_LEN: usize = 23usize;
7022 pub const DEFAULT: Self = Self {
7023 time_boot_ms: 0_u32,
7024 image_interval: 0.0_f32,
7025 recording_time_ms: 0_u32,
7026 available_capacity: 0.0_f32,
7027 image_status: 0_u8,
7028 video_status: 0_u8,
7029 image_count: 0_i32,
7030 camera_device_id: 0_u8,
7031 };
7032 #[cfg(feature = "arbitrary")]
7033 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7034 use arbitrary::{Arbitrary, Unstructured};
7035 let mut buf = [0u8; 1024];
7036 rng.fill_bytes(&mut buf);
7037 let mut unstructured = Unstructured::new(&buf);
7038 Self::arbitrary(&mut unstructured).unwrap_or_default()
7039 }
7040}
7041impl Default for CAMERA_CAPTURE_STATUS_DATA {
7042 fn default() -> Self {
7043 Self::DEFAULT.clone()
7044 }
7045}
7046impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7047 type Message = MavMessage;
7048 const ID: u32 = 262u32;
7049 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7050 const EXTRA_CRC: u8 = 12u8;
7051 const ENCODED_LEN: usize = 23usize;
7052 fn deser(
7053 _version: MavlinkVersion,
7054 __input: &[u8],
7055 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7056 let avail_len = __input.len();
7057 let mut payload_buf = [0; Self::ENCODED_LEN];
7058 let mut buf = if avail_len < Self::ENCODED_LEN {
7059 payload_buf[0..avail_len].copy_from_slice(__input);
7060 Bytes::new(&payload_buf)
7061 } else {
7062 Bytes::new(__input)
7063 };
7064 let mut __struct = Self::default();
7065 __struct.time_boot_ms = buf.get_u32_le();
7066 __struct.image_interval = buf.get_f32_le();
7067 __struct.recording_time_ms = buf.get_u32_le();
7068 __struct.available_capacity = buf.get_f32_le();
7069 __struct.image_status = buf.get_u8();
7070 __struct.video_status = buf.get_u8();
7071 __struct.image_count = buf.get_i32_le();
7072 __struct.camera_device_id = buf.get_u8();
7073 Ok(__struct)
7074 }
7075 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7076 let mut __tmp = BytesMut::new(bytes);
7077 #[allow(clippy::absurd_extreme_comparisons)]
7078 #[allow(unused_comparisons)]
7079 if __tmp.remaining() < Self::ENCODED_LEN {
7080 panic!(
7081 "buffer is too small (need {} bytes, but got {})",
7082 Self::ENCODED_LEN,
7083 __tmp.remaining(),
7084 )
7085 }
7086 __tmp.put_u32_le(self.time_boot_ms);
7087 __tmp.put_f32_le(self.image_interval);
7088 __tmp.put_u32_le(self.recording_time_ms);
7089 __tmp.put_f32_le(self.available_capacity);
7090 __tmp.put_u8(self.image_status);
7091 __tmp.put_u8(self.video_status);
7092 __tmp.put_i32_le(self.image_count);
7093 __tmp.put_u8(self.camera_device_id);
7094 if matches!(version, MavlinkVersion::V2) {
7095 let len = __tmp.len();
7096 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7097 } else {
7098 __tmp.len()
7099 }
7100 }
7101}
7102#[doc = "id: 271"]
7103#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7104#[derive(Debug, Clone, PartialEq)]
7105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7107pub struct CAMERA_FOV_STATUS_DATA {
7108 #[doc = "Timestamp (time since system boot)."]
7109 pub time_boot_ms: u32,
7110 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7111 pub lat_camera: i32,
7112 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7113 pub lon_camera: i32,
7114 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7115 pub alt_camera: i32,
7116 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7117 pub lat_image: i32,
7118 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7119 pub lon_image: i32,
7120 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7121 pub alt_image: i32,
7122 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7123 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7124 pub q: [f32; 4],
7125 #[doc = "Horizontal field of view (NaN if unknown)."]
7126 pub hfov: f32,
7127 #[doc = "Vertical field of view (NaN if unknown)."]
7128 pub vfov: f32,
7129 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7130 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7131 pub camera_device_id: u8,
7132}
7133impl CAMERA_FOV_STATUS_DATA {
7134 pub const ENCODED_LEN: usize = 53usize;
7135 pub const DEFAULT: Self = Self {
7136 time_boot_ms: 0_u32,
7137 lat_camera: 0_i32,
7138 lon_camera: 0_i32,
7139 alt_camera: 0_i32,
7140 lat_image: 0_i32,
7141 lon_image: 0_i32,
7142 alt_image: 0_i32,
7143 q: [0.0_f32; 4usize],
7144 hfov: 0.0_f32,
7145 vfov: 0.0_f32,
7146 camera_device_id: 0_u8,
7147 };
7148 #[cfg(feature = "arbitrary")]
7149 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7150 use arbitrary::{Arbitrary, Unstructured};
7151 let mut buf = [0u8; 1024];
7152 rng.fill_bytes(&mut buf);
7153 let mut unstructured = Unstructured::new(&buf);
7154 Self::arbitrary(&mut unstructured).unwrap_or_default()
7155 }
7156}
7157impl Default for CAMERA_FOV_STATUS_DATA {
7158 fn default() -> Self {
7159 Self::DEFAULT.clone()
7160 }
7161}
7162impl MessageData for CAMERA_FOV_STATUS_DATA {
7163 type Message = MavMessage;
7164 const ID: u32 = 271u32;
7165 const NAME: &'static str = "CAMERA_FOV_STATUS";
7166 const EXTRA_CRC: u8 = 22u8;
7167 const ENCODED_LEN: usize = 53usize;
7168 fn deser(
7169 _version: MavlinkVersion,
7170 __input: &[u8],
7171 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7172 let avail_len = __input.len();
7173 let mut payload_buf = [0; Self::ENCODED_LEN];
7174 let mut buf = if avail_len < Self::ENCODED_LEN {
7175 payload_buf[0..avail_len].copy_from_slice(__input);
7176 Bytes::new(&payload_buf)
7177 } else {
7178 Bytes::new(__input)
7179 };
7180 let mut __struct = Self::default();
7181 __struct.time_boot_ms = buf.get_u32_le();
7182 __struct.lat_camera = buf.get_i32_le();
7183 __struct.lon_camera = buf.get_i32_le();
7184 __struct.alt_camera = buf.get_i32_le();
7185 __struct.lat_image = buf.get_i32_le();
7186 __struct.lon_image = buf.get_i32_le();
7187 __struct.alt_image = buf.get_i32_le();
7188 for v in &mut __struct.q {
7189 let val = buf.get_f32_le();
7190 *v = val;
7191 }
7192 __struct.hfov = buf.get_f32_le();
7193 __struct.vfov = buf.get_f32_le();
7194 __struct.camera_device_id = buf.get_u8();
7195 Ok(__struct)
7196 }
7197 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7198 let mut __tmp = BytesMut::new(bytes);
7199 #[allow(clippy::absurd_extreme_comparisons)]
7200 #[allow(unused_comparisons)]
7201 if __tmp.remaining() < Self::ENCODED_LEN {
7202 panic!(
7203 "buffer is too small (need {} bytes, but got {})",
7204 Self::ENCODED_LEN,
7205 __tmp.remaining(),
7206 )
7207 }
7208 __tmp.put_u32_le(self.time_boot_ms);
7209 __tmp.put_i32_le(self.lat_camera);
7210 __tmp.put_i32_le(self.lon_camera);
7211 __tmp.put_i32_le(self.alt_camera);
7212 __tmp.put_i32_le(self.lat_image);
7213 __tmp.put_i32_le(self.lon_image);
7214 __tmp.put_i32_le(self.alt_image);
7215 for val in &self.q {
7216 __tmp.put_f32_le(*val);
7217 }
7218 __tmp.put_f32_le(self.hfov);
7219 __tmp.put_f32_le(self.vfov);
7220 __tmp.put_u8(self.camera_device_id);
7221 if matches!(version, MavlinkVersion::V2) {
7222 let len = __tmp.len();
7223 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7224 } else {
7225 __tmp.len()
7226 }
7227 }
7228}
7229#[doc = "id: 263"]
7230#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7231#[derive(Debug, Clone, PartialEq)]
7232#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7233#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7234pub struct CAMERA_IMAGE_CAPTURED_DATA {
7235 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7236 pub time_utc: u64,
7237 #[doc = "Timestamp (time since system boot)."]
7238 pub time_boot_ms: u32,
7239 #[doc = "Latitude where image was taken"]
7240 pub lat: i32,
7241 #[doc = "Longitude where capture was taken"]
7242 pub lon: i32,
7243 #[doc = "Altitude (MSL) where image was taken"]
7244 pub alt: i32,
7245 #[doc = "Altitude above ground"]
7246 pub relative_alt: i32,
7247 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7248 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7249 pub q: [f32; 4],
7250 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7251 pub image_index: i32,
7252 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7253 pub camera_id: u8,
7254 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7255 pub capture_result: i8,
7256 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7257 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7258 pub file_url: [u8; 205],
7259}
7260impl CAMERA_IMAGE_CAPTURED_DATA {
7261 pub const ENCODED_LEN: usize = 255usize;
7262 pub const DEFAULT: Self = Self {
7263 time_utc: 0_u64,
7264 time_boot_ms: 0_u32,
7265 lat: 0_i32,
7266 lon: 0_i32,
7267 alt: 0_i32,
7268 relative_alt: 0_i32,
7269 q: [0.0_f32; 4usize],
7270 image_index: 0_i32,
7271 camera_id: 0_u8,
7272 capture_result: 0_i8,
7273 file_url: [0_u8; 205usize],
7274 };
7275 #[cfg(feature = "arbitrary")]
7276 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7277 use arbitrary::{Arbitrary, Unstructured};
7278 let mut buf = [0u8; 1024];
7279 rng.fill_bytes(&mut buf);
7280 let mut unstructured = Unstructured::new(&buf);
7281 Self::arbitrary(&mut unstructured).unwrap_or_default()
7282 }
7283}
7284impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7285 fn default() -> Self {
7286 Self::DEFAULT.clone()
7287 }
7288}
7289impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7290 type Message = MavMessage;
7291 const ID: u32 = 263u32;
7292 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7293 const EXTRA_CRC: u8 = 133u8;
7294 const ENCODED_LEN: usize = 255usize;
7295 fn deser(
7296 _version: MavlinkVersion,
7297 __input: &[u8],
7298 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7299 let avail_len = __input.len();
7300 let mut payload_buf = [0; Self::ENCODED_LEN];
7301 let mut buf = if avail_len < Self::ENCODED_LEN {
7302 payload_buf[0..avail_len].copy_from_slice(__input);
7303 Bytes::new(&payload_buf)
7304 } else {
7305 Bytes::new(__input)
7306 };
7307 let mut __struct = Self::default();
7308 __struct.time_utc = buf.get_u64_le();
7309 __struct.time_boot_ms = buf.get_u32_le();
7310 __struct.lat = buf.get_i32_le();
7311 __struct.lon = buf.get_i32_le();
7312 __struct.alt = buf.get_i32_le();
7313 __struct.relative_alt = buf.get_i32_le();
7314 for v in &mut __struct.q {
7315 let val = buf.get_f32_le();
7316 *v = val;
7317 }
7318 __struct.image_index = buf.get_i32_le();
7319 __struct.camera_id = buf.get_u8();
7320 __struct.capture_result = buf.get_i8();
7321 for v in &mut __struct.file_url {
7322 let val = buf.get_u8();
7323 *v = val;
7324 }
7325 Ok(__struct)
7326 }
7327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7328 let mut __tmp = BytesMut::new(bytes);
7329 #[allow(clippy::absurd_extreme_comparisons)]
7330 #[allow(unused_comparisons)]
7331 if __tmp.remaining() < Self::ENCODED_LEN {
7332 panic!(
7333 "buffer is too small (need {} bytes, but got {})",
7334 Self::ENCODED_LEN,
7335 __tmp.remaining(),
7336 )
7337 }
7338 __tmp.put_u64_le(self.time_utc);
7339 __tmp.put_u32_le(self.time_boot_ms);
7340 __tmp.put_i32_le(self.lat);
7341 __tmp.put_i32_le(self.lon);
7342 __tmp.put_i32_le(self.alt);
7343 __tmp.put_i32_le(self.relative_alt);
7344 for val in &self.q {
7345 __tmp.put_f32_le(*val);
7346 }
7347 __tmp.put_i32_le(self.image_index);
7348 __tmp.put_u8(self.camera_id);
7349 __tmp.put_i8(self.capture_result);
7350 for val in &self.file_url {
7351 __tmp.put_u8(*val);
7352 }
7353 if matches!(version, MavlinkVersion::V2) {
7354 let len = __tmp.len();
7355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7356 } else {
7357 __tmp.len()
7358 }
7359 }
7360}
7361#[doc = "id: 259"]
7362#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7363#[derive(Debug, Clone, PartialEq)]
7364#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7366pub struct CAMERA_INFORMATION_DATA {
7367 #[doc = "Timestamp (time since system boot)."]
7368 pub time_boot_ms: u32,
7369 #[doc = "0xff). Use 0 if not known."]
7370 pub firmware_version: u32,
7371 #[doc = "Focal length. Use NaN if not known."]
7372 pub focal_length: f32,
7373 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7374 pub sensor_size_h: f32,
7375 #[doc = "Image sensor size vertical. Use NaN if not known."]
7376 pub sensor_size_v: f32,
7377 #[doc = "Bitmap of camera capability flags."]
7378 pub flags: CameraCapFlags,
7379 #[doc = "Horizontal image resolution. Use 0 if not known."]
7380 pub resolution_h: u16,
7381 #[doc = "Vertical image resolution. Use 0 if not known."]
7382 pub resolution_v: u16,
7383 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7384 pub cam_definition_version: u16,
7385 #[doc = "Name of the camera vendor"]
7386 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7387 pub vendor_name: [u8; 32],
7388 #[doc = "Name of the camera model"]
7389 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7390 pub model_name: [u8; 32],
7391 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7392 pub lens_id: u8,
7393 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7394 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7395 pub cam_definition_uri: [u8; 140],
7396 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7397 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7398 pub gimbal_device_id: u8,
7399 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7400 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7401 pub camera_device_id: u8,
7402}
7403impl CAMERA_INFORMATION_DATA {
7404 pub const ENCODED_LEN: usize = 237usize;
7405 pub const DEFAULT: Self = Self {
7406 time_boot_ms: 0_u32,
7407 firmware_version: 0_u32,
7408 focal_length: 0.0_f32,
7409 sensor_size_h: 0.0_f32,
7410 sensor_size_v: 0.0_f32,
7411 flags: CameraCapFlags::DEFAULT,
7412 resolution_h: 0_u16,
7413 resolution_v: 0_u16,
7414 cam_definition_version: 0_u16,
7415 vendor_name: [0_u8; 32usize],
7416 model_name: [0_u8; 32usize],
7417 lens_id: 0_u8,
7418 cam_definition_uri: [0_u8; 140usize],
7419 gimbal_device_id: 0_u8,
7420 camera_device_id: 0_u8,
7421 };
7422 #[cfg(feature = "arbitrary")]
7423 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7424 use arbitrary::{Arbitrary, Unstructured};
7425 let mut buf = [0u8; 1024];
7426 rng.fill_bytes(&mut buf);
7427 let mut unstructured = Unstructured::new(&buf);
7428 Self::arbitrary(&mut unstructured).unwrap_or_default()
7429 }
7430}
7431impl Default for CAMERA_INFORMATION_DATA {
7432 fn default() -> Self {
7433 Self::DEFAULT.clone()
7434 }
7435}
7436impl MessageData for CAMERA_INFORMATION_DATA {
7437 type Message = MavMessage;
7438 const ID: u32 = 259u32;
7439 const NAME: &'static str = "CAMERA_INFORMATION";
7440 const EXTRA_CRC: u8 = 92u8;
7441 const ENCODED_LEN: usize = 237usize;
7442 fn deser(
7443 _version: MavlinkVersion,
7444 __input: &[u8],
7445 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7446 let avail_len = __input.len();
7447 let mut payload_buf = [0; Self::ENCODED_LEN];
7448 let mut buf = if avail_len < Self::ENCODED_LEN {
7449 payload_buf[0..avail_len].copy_from_slice(__input);
7450 Bytes::new(&payload_buf)
7451 } else {
7452 Bytes::new(__input)
7453 };
7454 let mut __struct = Self::default();
7455 __struct.time_boot_ms = buf.get_u32_le();
7456 __struct.firmware_version = buf.get_u32_le();
7457 __struct.focal_length = buf.get_f32_le();
7458 __struct.sensor_size_h = buf.get_f32_le();
7459 __struct.sensor_size_v = buf.get_f32_le();
7460 let tmp = buf.get_u32_le();
7461 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7462 ::mavlink_core::error::ParserError::InvalidFlag {
7463 flag_type: "CameraCapFlags",
7464 value: tmp as u32,
7465 },
7466 )?;
7467 __struct.resolution_h = buf.get_u16_le();
7468 __struct.resolution_v = buf.get_u16_le();
7469 __struct.cam_definition_version = buf.get_u16_le();
7470 for v in &mut __struct.vendor_name {
7471 let val = buf.get_u8();
7472 *v = val;
7473 }
7474 for v in &mut __struct.model_name {
7475 let val = buf.get_u8();
7476 *v = val;
7477 }
7478 __struct.lens_id = buf.get_u8();
7479 for v in &mut __struct.cam_definition_uri {
7480 let val = buf.get_u8();
7481 *v = val;
7482 }
7483 __struct.gimbal_device_id = buf.get_u8();
7484 __struct.camera_device_id = buf.get_u8();
7485 Ok(__struct)
7486 }
7487 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7488 let mut __tmp = BytesMut::new(bytes);
7489 #[allow(clippy::absurd_extreme_comparisons)]
7490 #[allow(unused_comparisons)]
7491 if __tmp.remaining() < Self::ENCODED_LEN {
7492 panic!(
7493 "buffer is too small (need {} bytes, but got {})",
7494 Self::ENCODED_LEN,
7495 __tmp.remaining(),
7496 )
7497 }
7498 __tmp.put_u32_le(self.time_boot_ms);
7499 __tmp.put_u32_le(self.firmware_version);
7500 __tmp.put_f32_le(self.focal_length);
7501 __tmp.put_f32_le(self.sensor_size_h);
7502 __tmp.put_f32_le(self.sensor_size_v);
7503 __tmp.put_u32_le(self.flags.bits());
7504 __tmp.put_u16_le(self.resolution_h);
7505 __tmp.put_u16_le(self.resolution_v);
7506 __tmp.put_u16_le(self.cam_definition_version);
7507 for val in &self.vendor_name {
7508 __tmp.put_u8(*val);
7509 }
7510 for val in &self.model_name {
7511 __tmp.put_u8(*val);
7512 }
7513 __tmp.put_u8(self.lens_id);
7514 for val in &self.cam_definition_uri {
7515 __tmp.put_u8(*val);
7516 }
7517 __tmp.put_u8(self.gimbal_device_id);
7518 __tmp.put_u8(self.camera_device_id);
7519 if matches!(version, MavlinkVersion::V2) {
7520 let len = __tmp.len();
7521 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7522 } else {
7523 __tmp.len()
7524 }
7525 }
7526}
7527#[doc = "id: 260"]
7528#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7529#[derive(Debug, Clone, PartialEq)]
7530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7532pub struct CAMERA_SETTINGS_DATA {
7533 #[doc = "Timestamp (time since system boot)."]
7534 pub time_boot_ms: u32,
7535 #[doc = "Camera mode"]
7536 pub mode_id: CameraMode,
7537 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7538 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7539 pub zoomLevel: f32,
7540 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7541 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7542 pub focusLevel: f32,
7543 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7544 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7545 pub camera_device_id: u8,
7546}
7547impl CAMERA_SETTINGS_DATA {
7548 pub const ENCODED_LEN: usize = 14usize;
7549 pub const DEFAULT: Self = Self {
7550 time_boot_ms: 0_u32,
7551 mode_id: CameraMode::DEFAULT,
7552 zoomLevel: 0.0_f32,
7553 focusLevel: 0.0_f32,
7554 camera_device_id: 0_u8,
7555 };
7556 #[cfg(feature = "arbitrary")]
7557 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7558 use arbitrary::{Arbitrary, Unstructured};
7559 let mut buf = [0u8; 1024];
7560 rng.fill_bytes(&mut buf);
7561 let mut unstructured = Unstructured::new(&buf);
7562 Self::arbitrary(&mut unstructured).unwrap_or_default()
7563 }
7564}
7565impl Default for CAMERA_SETTINGS_DATA {
7566 fn default() -> Self {
7567 Self::DEFAULT.clone()
7568 }
7569}
7570impl MessageData for CAMERA_SETTINGS_DATA {
7571 type Message = MavMessage;
7572 const ID: u32 = 260u32;
7573 const NAME: &'static str = "CAMERA_SETTINGS";
7574 const EXTRA_CRC: u8 = 146u8;
7575 const ENCODED_LEN: usize = 14usize;
7576 fn deser(
7577 _version: MavlinkVersion,
7578 __input: &[u8],
7579 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7580 let avail_len = __input.len();
7581 let mut payload_buf = [0; Self::ENCODED_LEN];
7582 let mut buf = if avail_len < Self::ENCODED_LEN {
7583 payload_buf[0..avail_len].copy_from_slice(__input);
7584 Bytes::new(&payload_buf)
7585 } else {
7586 Bytes::new(__input)
7587 };
7588 let mut __struct = Self::default();
7589 __struct.time_boot_ms = buf.get_u32_le();
7590 let tmp = buf.get_u8();
7591 __struct.mode_id =
7592 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7593 enum_type: "CameraMode",
7594 value: tmp as u32,
7595 })?;
7596 __struct.zoomLevel = buf.get_f32_le();
7597 __struct.focusLevel = buf.get_f32_le();
7598 __struct.camera_device_id = buf.get_u8();
7599 Ok(__struct)
7600 }
7601 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7602 let mut __tmp = BytesMut::new(bytes);
7603 #[allow(clippy::absurd_extreme_comparisons)]
7604 #[allow(unused_comparisons)]
7605 if __tmp.remaining() < Self::ENCODED_LEN {
7606 panic!(
7607 "buffer is too small (need {} bytes, but got {})",
7608 Self::ENCODED_LEN,
7609 __tmp.remaining(),
7610 )
7611 }
7612 __tmp.put_u32_le(self.time_boot_ms);
7613 __tmp.put_u8(self.mode_id as u8);
7614 __tmp.put_f32_le(self.zoomLevel);
7615 __tmp.put_f32_le(self.focusLevel);
7616 __tmp.put_u8(self.camera_device_id);
7617 if matches!(version, MavlinkVersion::V2) {
7618 let len = __tmp.len();
7619 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7620 } else {
7621 __tmp.len()
7622 }
7623 }
7624}
7625#[doc = "id: 277"]
7626#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7627#[derive(Debug, Clone, PartialEq)]
7628#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7629#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7630pub struct CAMERA_THERMAL_RANGE_DATA {
7631 #[doc = "Timestamp (time since system boot)."]
7632 pub time_boot_ms: u32,
7633 #[doc = "Temperature max."]
7634 pub max: f32,
7635 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7636 pub max_point_x: f32,
7637 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7638 pub max_point_y: f32,
7639 #[doc = "Temperature min."]
7640 pub min: f32,
7641 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7642 pub min_point_x: f32,
7643 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7644 pub min_point_y: f32,
7645 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7646 pub stream_id: u8,
7647 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7648 pub camera_device_id: u8,
7649}
7650impl CAMERA_THERMAL_RANGE_DATA {
7651 pub const ENCODED_LEN: usize = 30usize;
7652 pub const DEFAULT: Self = Self {
7653 time_boot_ms: 0_u32,
7654 max: 0.0_f32,
7655 max_point_x: 0.0_f32,
7656 max_point_y: 0.0_f32,
7657 min: 0.0_f32,
7658 min_point_x: 0.0_f32,
7659 min_point_y: 0.0_f32,
7660 stream_id: 0_u8,
7661 camera_device_id: 0_u8,
7662 };
7663 #[cfg(feature = "arbitrary")]
7664 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7665 use arbitrary::{Arbitrary, Unstructured};
7666 let mut buf = [0u8; 1024];
7667 rng.fill_bytes(&mut buf);
7668 let mut unstructured = Unstructured::new(&buf);
7669 Self::arbitrary(&mut unstructured).unwrap_or_default()
7670 }
7671}
7672impl Default for CAMERA_THERMAL_RANGE_DATA {
7673 fn default() -> Self {
7674 Self::DEFAULT.clone()
7675 }
7676}
7677impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7678 type Message = MavMessage;
7679 const ID: u32 = 277u32;
7680 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7681 const EXTRA_CRC: u8 = 62u8;
7682 const ENCODED_LEN: usize = 30usize;
7683 fn deser(
7684 _version: MavlinkVersion,
7685 __input: &[u8],
7686 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7687 let avail_len = __input.len();
7688 let mut payload_buf = [0; Self::ENCODED_LEN];
7689 let mut buf = if avail_len < Self::ENCODED_LEN {
7690 payload_buf[0..avail_len].copy_from_slice(__input);
7691 Bytes::new(&payload_buf)
7692 } else {
7693 Bytes::new(__input)
7694 };
7695 let mut __struct = Self::default();
7696 __struct.time_boot_ms = buf.get_u32_le();
7697 __struct.max = buf.get_f32_le();
7698 __struct.max_point_x = buf.get_f32_le();
7699 __struct.max_point_y = buf.get_f32_le();
7700 __struct.min = buf.get_f32_le();
7701 __struct.min_point_x = buf.get_f32_le();
7702 __struct.min_point_y = buf.get_f32_le();
7703 __struct.stream_id = buf.get_u8();
7704 __struct.camera_device_id = buf.get_u8();
7705 Ok(__struct)
7706 }
7707 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7708 let mut __tmp = BytesMut::new(bytes);
7709 #[allow(clippy::absurd_extreme_comparisons)]
7710 #[allow(unused_comparisons)]
7711 if __tmp.remaining() < Self::ENCODED_LEN {
7712 panic!(
7713 "buffer is too small (need {} bytes, but got {})",
7714 Self::ENCODED_LEN,
7715 __tmp.remaining(),
7716 )
7717 }
7718 __tmp.put_u32_le(self.time_boot_ms);
7719 __tmp.put_f32_le(self.max);
7720 __tmp.put_f32_le(self.max_point_x);
7721 __tmp.put_f32_le(self.max_point_y);
7722 __tmp.put_f32_le(self.min);
7723 __tmp.put_f32_le(self.min_point_x);
7724 __tmp.put_f32_le(self.min_point_y);
7725 __tmp.put_u8(self.stream_id);
7726 __tmp.put_u8(self.camera_device_id);
7727 if matches!(version, MavlinkVersion::V2) {
7728 let len = __tmp.len();
7729 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7730 } else {
7731 __tmp.len()
7732 }
7733 }
7734}
7735#[doc = "id: 276"]
7736#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7737#[derive(Debug, Clone, PartialEq)]
7738#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7739#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7740pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7741 #[doc = "Latitude of tracked object"]
7742 pub lat: i32,
7743 #[doc = "Longitude of tracked object"]
7744 pub lon: i32,
7745 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7746 pub alt: f32,
7747 #[doc = "Horizontal accuracy. NAN if unknown"]
7748 pub h_acc: f32,
7749 #[doc = "Vertical accuracy. NAN if unknown"]
7750 pub v_acc: f32,
7751 #[doc = "North velocity of tracked object. NAN if unknown"]
7752 pub vel_n: f32,
7753 #[doc = "East velocity of tracked object. NAN if unknown"]
7754 pub vel_e: f32,
7755 #[doc = "Down velocity of tracked object. NAN if unknown"]
7756 pub vel_d: f32,
7757 #[doc = "Velocity accuracy. NAN if unknown"]
7758 pub vel_acc: f32,
7759 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7760 pub dist: f32,
7761 #[doc = "Heading in radians, in NED. NAN if unknown"]
7762 pub hdg: f32,
7763 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7764 pub hdg_acc: f32,
7765 #[doc = "Current tracking status"]
7766 pub tracking_status: CameraTrackingStatusFlags,
7767 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7768 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7769 pub camera_device_id: u8,
7770}
7771impl CAMERA_TRACKING_GEO_STATUS_DATA {
7772 pub const ENCODED_LEN: usize = 50usize;
7773 pub const DEFAULT: Self = Self {
7774 lat: 0_i32,
7775 lon: 0_i32,
7776 alt: 0.0_f32,
7777 h_acc: 0.0_f32,
7778 v_acc: 0.0_f32,
7779 vel_n: 0.0_f32,
7780 vel_e: 0.0_f32,
7781 vel_d: 0.0_f32,
7782 vel_acc: 0.0_f32,
7783 dist: 0.0_f32,
7784 hdg: 0.0_f32,
7785 hdg_acc: 0.0_f32,
7786 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7787 camera_device_id: 0_u8,
7788 };
7789 #[cfg(feature = "arbitrary")]
7790 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7791 use arbitrary::{Arbitrary, Unstructured};
7792 let mut buf = [0u8; 1024];
7793 rng.fill_bytes(&mut buf);
7794 let mut unstructured = Unstructured::new(&buf);
7795 Self::arbitrary(&mut unstructured).unwrap_or_default()
7796 }
7797}
7798impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7799 fn default() -> Self {
7800 Self::DEFAULT.clone()
7801 }
7802}
7803impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7804 type Message = MavMessage;
7805 const ID: u32 = 276u32;
7806 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7807 const EXTRA_CRC: u8 = 18u8;
7808 const ENCODED_LEN: usize = 50usize;
7809 fn deser(
7810 _version: MavlinkVersion,
7811 __input: &[u8],
7812 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7813 let avail_len = __input.len();
7814 let mut payload_buf = [0; Self::ENCODED_LEN];
7815 let mut buf = if avail_len < Self::ENCODED_LEN {
7816 payload_buf[0..avail_len].copy_from_slice(__input);
7817 Bytes::new(&payload_buf)
7818 } else {
7819 Bytes::new(__input)
7820 };
7821 let mut __struct = Self::default();
7822 __struct.lat = buf.get_i32_le();
7823 __struct.lon = buf.get_i32_le();
7824 __struct.alt = buf.get_f32_le();
7825 __struct.h_acc = buf.get_f32_le();
7826 __struct.v_acc = buf.get_f32_le();
7827 __struct.vel_n = buf.get_f32_le();
7828 __struct.vel_e = buf.get_f32_le();
7829 __struct.vel_d = buf.get_f32_le();
7830 __struct.vel_acc = buf.get_f32_le();
7831 __struct.dist = buf.get_f32_le();
7832 __struct.hdg = buf.get_f32_le();
7833 __struct.hdg_acc = buf.get_f32_le();
7834 let tmp = buf.get_u8();
7835 __struct.tracking_status =
7836 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7837 enum_type: "CameraTrackingStatusFlags",
7838 value: tmp as u32,
7839 })?;
7840 __struct.camera_device_id = buf.get_u8();
7841 Ok(__struct)
7842 }
7843 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7844 let mut __tmp = BytesMut::new(bytes);
7845 #[allow(clippy::absurd_extreme_comparisons)]
7846 #[allow(unused_comparisons)]
7847 if __tmp.remaining() < Self::ENCODED_LEN {
7848 panic!(
7849 "buffer is too small (need {} bytes, but got {})",
7850 Self::ENCODED_LEN,
7851 __tmp.remaining(),
7852 )
7853 }
7854 __tmp.put_i32_le(self.lat);
7855 __tmp.put_i32_le(self.lon);
7856 __tmp.put_f32_le(self.alt);
7857 __tmp.put_f32_le(self.h_acc);
7858 __tmp.put_f32_le(self.v_acc);
7859 __tmp.put_f32_le(self.vel_n);
7860 __tmp.put_f32_le(self.vel_e);
7861 __tmp.put_f32_le(self.vel_d);
7862 __tmp.put_f32_le(self.vel_acc);
7863 __tmp.put_f32_le(self.dist);
7864 __tmp.put_f32_le(self.hdg);
7865 __tmp.put_f32_le(self.hdg_acc);
7866 __tmp.put_u8(self.tracking_status as u8);
7867 __tmp.put_u8(self.camera_device_id);
7868 if matches!(version, MavlinkVersion::V2) {
7869 let len = __tmp.len();
7870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7871 } else {
7872 __tmp.len()
7873 }
7874 }
7875}
7876#[doc = "id: 275"]
7877#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7878#[derive(Debug, Clone, PartialEq)]
7879#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7880#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7881pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7882 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7883 pub point_x: f32,
7884 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7885 pub point_y: f32,
7886 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7887 pub radius: f32,
7888 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7889 pub rec_top_x: f32,
7890 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7891 pub rec_top_y: f32,
7892 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7893 pub rec_bottom_x: f32,
7894 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7895 pub rec_bottom_y: f32,
7896 #[doc = "Current tracking status"]
7897 pub tracking_status: CameraTrackingStatusFlags,
7898 #[doc = "Current tracking mode"]
7899 pub tracking_mode: CameraTrackingMode,
7900 #[doc = "Defines location of target data"]
7901 pub target_data: CameraTrackingTargetData,
7902 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7903 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7904 pub camera_device_id: u8,
7905}
7906impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7907 pub const ENCODED_LEN: usize = 32usize;
7908 pub const DEFAULT: Self = Self {
7909 point_x: 0.0_f32,
7910 point_y: 0.0_f32,
7911 radius: 0.0_f32,
7912 rec_top_x: 0.0_f32,
7913 rec_top_y: 0.0_f32,
7914 rec_bottom_x: 0.0_f32,
7915 rec_bottom_y: 0.0_f32,
7916 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7917 tracking_mode: CameraTrackingMode::DEFAULT,
7918 target_data: CameraTrackingTargetData::DEFAULT,
7919 camera_device_id: 0_u8,
7920 };
7921 #[cfg(feature = "arbitrary")]
7922 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7923 use arbitrary::{Arbitrary, Unstructured};
7924 let mut buf = [0u8; 1024];
7925 rng.fill_bytes(&mut buf);
7926 let mut unstructured = Unstructured::new(&buf);
7927 Self::arbitrary(&mut unstructured).unwrap_or_default()
7928 }
7929}
7930impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7931 fn default() -> Self {
7932 Self::DEFAULT.clone()
7933 }
7934}
7935impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7936 type Message = MavMessage;
7937 const ID: u32 = 275u32;
7938 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7939 const EXTRA_CRC: u8 = 126u8;
7940 const ENCODED_LEN: usize = 32usize;
7941 fn deser(
7942 _version: MavlinkVersion,
7943 __input: &[u8],
7944 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7945 let avail_len = __input.len();
7946 let mut payload_buf = [0; Self::ENCODED_LEN];
7947 let mut buf = if avail_len < Self::ENCODED_LEN {
7948 payload_buf[0..avail_len].copy_from_slice(__input);
7949 Bytes::new(&payload_buf)
7950 } else {
7951 Bytes::new(__input)
7952 };
7953 let mut __struct = Self::default();
7954 __struct.point_x = buf.get_f32_le();
7955 __struct.point_y = buf.get_f32_le();
7956 __struct.radius = buf.get_f32_le();
7957 __struct.rec_top_x = buf.get_f32_le();
7958 __struct.rec_top_y = buf.get_f32_le();
7959 __struct.rec_bottom_x = buf.get_f32_le();
7960 __struct.rec_bottom_y = buf.get_f32_le();
7961 let tmp = buf.get_u8();
7962 __struct.tracking_status =
7963 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7964 enum_type: "CameraTrackingStatusFlags",
7965 value: tmp as u32,
7966 })?;
7967 let tmp = buf.get_u8();
7968 __struct.tracking_mode =
7969 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7970 enum_type: "CameraTrackingMode",
7971 value: tmp as u32,
7972 })?;
7973 let tmp = buf.get_u8();
7974 __struct.target_data =
7975 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
7976 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7977 flag_type: "CameraTrackingTargetData",
7978 value: tmp as u32,
7979 })?;
7980 __struct.camera_device_id = buf.get_u8();
7981 Ok(__struct)
7982 }
7983 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7984 let mut __tmp = BytesMut::new(bytes);
7985 #[allow(clippy::absurd_extreme_comparisons)]
7986 #[allow(unused_comparisons)]
7987 if __tmp.remaining() < Self::ENCODED_LEN {
7988 panic!(
7989 "buffer is too small (need {} bytes, but got {})",
7990 Self::ENCODED_LEN,
7991 __tmp.remaining(),
7992 )
7993 }
7994 __tmp.put_f32_le(self.point_x);
7995 __tmp.put_f32_le(self.point_y);
7996 __tmp.put_f32_le(self.radius);
7997 __tmp.put_f32_le(self.rec_top_x);
7998 __tmp.put_f32_le(self.rec_top_y);
7999 __tmp.put_f32_le(self.rec_bottom_x);
8000 __tmp.put_f32_le(self.rec_bottom_y);
8001 __tmp.put_u8(self.tracking_status as u8);
8002 __tmp.put_u8(self.tracking_mode as u8);
8003 __tmp.put_u8(self.target_data.bits());
8004 __tmp.put_u8(self.camera_device_id);
8005 if matches!(version, MavlinkVersion::V2) {
8006 let len = __tmp.len();
8007 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8008 } else {
8009 __tmp.len()
8010 }
8011 }
8012}
8013#[doc = "id: 112"]
8014#[doc = "Camera-IMU triggering and synchronisation message."]
8015#[derive(Debug, Clone, PartialEq)]
8016#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8017#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8018pub struct CAMERA_TRIGGER_DATA {
8019 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8020 pub time_usec: u64,
8021 #[doc = "Image frame sequence"]
8022 pub seq: u32,
8023}
8024impl CAMERA_TRIGGER_DATA {
8025 pub const ENCODED_LEN: usize = 12usize;
8026 pub const DEFAULT: Self = Self {
8027 time_usec: 0_u64,
8028 seq: 0_u32,
8029 };
8030 #[cfg(feature = "arbitrary")]
8031 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8032 use arbitrary::{Arbitrary, Unstructured};
8033 let mut buf = [0u8; 1024];
8034 rng.fill_bytes(&mut buf);
8035 let mut unstructured = Unstructured::new(&buf);
8036 Self::arbitrary(&mut unstructured).unwrap_or_default()
8037 }
8038}
8039impl Default for CAMERA_TRIGGER_DATA {
8040 fn default() -> Self {
8041 Self::DEFAULT.clone()
8042 }
8043}
8044impl MessageData for CAMERA_TRIGGER_DATA {
8045 type Message = MavMessage;
8046 const ID: u32 = 112u32;
8047 const NAME: &'static str = "CAMERA_TRIGGER";
8048 const EXTRA_CRC: u8 = 174u8;
8049 const ENCODED_LEN: usize = 12usize;
8050 fn deser(
8051 _version: MavlinkVersion,
8052 __input: &[u8],
8053 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8054 let avail_len = __input.len();
8055 let mut payload_buf = [0; Self::ENCODED_LEN];
8056 let mut buf = if avail_len < Self::ENCODED_LEN {
8057 payload_buf[0..avail_len].copy_from_slice(__input);
8058 Bytes::new(&payload_buf)
8059 } else {
8060 Bytes::new(__input)
8061 };
8062 let mut __struct = Self::default();
8063 __struct.time_usec = buf.get_u64_le();
8064 __struct.seq = buf.get_u32_le();
8065 Ok(__struct)
8066 }
8067 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8068 let mut __tmp = BytesMut::new(bytes);
8069 #[allow(clippy::absurd_extreme_comparisons)]
8070 #[allow(unused_comparisons)]
8071 if __tmp.remaining() < Self::ENCODED_LEN {
8072 panic!(
8073 "buffer is too small (need {} bytes, but got {})",
8074 Self::ENCODED_LEN,
8075 __tmp.remaining(),
8076 )
8077 }
8078 __tmp.put_u64_le(self.time_usec);
8079 __tmp.put_u32_le(self.seq);
8080 if matches!(version, MavlinkVersion::V2) {
8081 let len = __tmp.len();
8082 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8083 } else {
8084 __tmp.len()
8085 }
8086 }
8087}
8088#[doc = "id: 387"]
8089#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8090#[derive(Debug, Clone, PartialEq)]
8091#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8093pub struct CANFD_FRAME_DATA {
8094 #[doc = "Frame ID"]
8095 pub id: u32,
8096 #[doc = "System ID."]
8097 pub target_system: u8,
8098 #[doc = "Component ID."]
8099 pub target_component: u8,
8100 #[doc = "bus number"]
8101 pub bus: u8,
8102 #[doc = "Frame length"]
8103 pub len: u8,
8104 #[doc = "Frame data"]
8105 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8106 pub data: [u8; 64],
8107}
8108impl CANFD_FRAME_DATA {
8109 pub const ENCODED_LEN: usize = 72usize;
8110 pub const DEFAULT: Self = Self {
8111 id: 0_u32,
8112 target_system: 0_u8,
8113 target_component: 0_u8,
8114 bus: 0_u8,
8115 len: 0_u8,
8116 data: [0_u8; 64usize],
8117 };
8118 #[cfg(feature = "arbitrary")]
8119 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8120 use arbitrary::{Arbitrary, Unstructured};
8121 let mut buf = [0u8; 1024];
8122 rng.fill_bytes(&mut buf);
8123 let mut unstructured = Unstructured::new(&buf);
8124 Self::arbitrary(&mut unstructured).unwrap_or_default()
8125 }
8126}
8127impl Default for CANFD_FRAME_DATA {
8128 fn default() -> Self {
8129 Self::DEFAULT.clone()
8130 }
8131}
8132impl MessageData for CANFD_FRAME_DATA {
8133 type Message = MavMessage;
8134 const ID: u32 = 387u32;
8135 const NAME: &'static str = "CANFD_FRAME";
8136 const EXTRA_CRC: u8 = 4u8;
8137 const ENCODED_LEN: usize = 72usize;
8138 fn deser(
8139 _version: MavlinkVersion,
8140 __input: &[u8],
8141 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8142 let avail_len = __input.len();
8143 let mut payload_buf = [0; Self::ENCODED_LEN];
8144 let mut buf = if avail_len < Self::ENCODED_LEN {
8145 payload_buf[0..avail_len].copy_from_slice(__input);
8146 Bytes::new(&payload_buf)
8147 } else {
8148 Bytes::new(__input)
8149 };
8150 let mut __struct = Self::default();
8151 __struct.id = buf.get_u32_le();
8152 __struct.target_system = buf.get_u8();
8153 __struct.target_component = buf.get_u8();
8154 __struct.bus = buf.get_u8();
8155 __struct.len = buf.get_u8();
8156 for v in &mut __struct.data {
8157 let val = buf.get_u8();
8158 *v = val;
8159 }
8160 Ok(__struct)
8161 }
8162 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8163 let mut __tmp = BytesMut::new(bytes);
8164 #[allow(clippy::absurd_extreme_comparisons)]
8165 #[allow(unused_comparisons)]
8166 if __tmp.remaining() < Self::ENCODED_LEN {
8167 panic!(
8168 "buffer is too small (need {} bytes, but got {})",
8169 Self::ENCODED_LEN,
8170 __tmp.remaining(),
8171 )
8172 }
8173 __tmp.put_u32_le(self.id);
8174 __tmp.put_u8(self.target_system);
8175 __tmp.put_u8(self.target_component);
8176 __tmp.put_u8(self.bus);
8177 __tmp.put_u8(self.len);
8178 for val in &self.data {
8179 __tmp.put_u8(*val);
8180 }
8181 if matches!(version, MavlinkVersion::V2) {
8182 let len = __tmp.len();
8183 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8184 } else {
8185 __tmp.len()
8186 }
8187 }
8188}
8189#[doc = "id: 388"]
8190#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8191#[derive(Debug, Clone, PartialEq)]
8192#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8194pub struct CAN_FILTER_MODIFY_DATA {
8195 #[doc = "filter IDs, length num_ids"]
8196 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8197 pub ids: [u16; 16],
8198 #[doc = "System ID."]
8199 pub target_system: u8,
8200 #[doc = "Component ID."]
8201 pub target_component: u8,
8202 #[doc = "bus number"]
8203 pub bus: u8,
8204 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8205 pub operation: CanFilterOp,
8206 #[doc = "number of IDs in filter list"]
8207 pub num_ids: u8,
8208}
8209impl CAN_FILTER_MODIFY_DATA {
8210 pub const ENCODED_LEN: usize = 37usize;
8211 pub const DEFAULT: Self = Self {
8212 ids: [0_u16; 16usize],
8213 target_system: 0_u8,
8214 target_component: 0_u8,
8215 bus: 0_u8,
8216 operation: CanFilterOp::DEFAULT,
8217 num_ids: 0_u8,
8218 };
8219 #[cfg(feature = "arbitrary")]
8220 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8221 use arbitrary::{Arbitrary, Unstructured};
8222 let mut buf = [0u8; 1024];
8223 rng.fill_bytes(&mut buf);
8224 let mut unstructured = Unstructured::new(&buf);
8225 Self::arbitrary(&mut unstructured).unwrap_or_default()
8226 }
8227}
8228impl Default for CAN_FILTER_MODIFY_DATA {
8229 fn default() -> Self {
8230 Self::DEFAULT.clone()
8231 }
8232}
8233impl MessageData for CAN_FILTER_MODIFY_DATA {
8234 type Message = MavMessage;
8235 const ID: u32 = 388u32;
8236 const NAME: &'static str = "CAN_FILTER_MODIFY";
8237 const EXTRA_CRC: u8 = 8u8;
8238 const ENCODED_LEN: usize = 37usize;
8239 fn deser(
8240 _version: MavlinkVersion,
8241 __input: &[u8],
8242 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8243 let avail_len = __input.len();
8244 let mut payload_buf = [0; Self::ENCODED_LEN];
8245 let mut buf = if avail_len < Self::ENCODED_LEN {
8246 payload_buf[0..avail_len].copy_from_slice(__input);
8247 Bytes::new(&payload_buf)
8248 } else {
8249 Bytes::new(__input)
8250 };
8251 let mut __struct = Self::default();
8252 for v in &mut __struct.ids {
8253 let val = buf.get_u16_le();
8254 *v = val;
8255 }
8256 __struct.target_system = buf.get_u8();
8257 __struct.target_component = buf.get_u8();
8258 __struct.bus = buf.get_u8();
8259 let tmp = buf.get_u8();
8260 __struct.operation =
8261 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8262 enum_type: "CanFilterOp",
8263 value: tmp as u32,
8264 })?;
8265 __struct.num_ids = buf.get_u8();
8266 Ok(__struct)
8267 }
8268 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8269 let mut __tmp = BytesMut::new(bytes);
8270 #[allow(clippy::absurd_extreme_comparisons)]
8271 #[allow(unused_comparisons)]
8272 if __tmp.remaining() < Self::ENCODED_LEN {
8273 panic!(
8274 "buffer is too small (need {} bytes, but got {})",
8275 Self::ENCODED_LEN,
8276 __tmp.remaining(),
8277 )
8278 }
8279 for val in &self.ids {
8280 __tmp.put_u16_le(*val);
8281 }
8282 __tmp.put_u8(self.target_system);
8283 __tmp.put_u8(self.target_component);
8284 __tmp.put_u8(self.bus);
8285 __tmp.put_u8(self.operation as u8);
8286 __tmp.put_u8(self.num_ids);
8287 if matches!(version, MavlinkVersion::V2) {
8288 let len = __tmp.len();
8289 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8290 } else {
8291 __tmp.len()
8292 }
8293 }
8294}
8295#[doc = "id: 386"]
8296#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8297#[derive(Debug, Clone, PartialEq)]
8298#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8299#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8300pub struct CAN_FRAME_DATA {
8301 #[doc = "Frame ID"]
8302 pub id: u32,
8303 #[doc = "System ID."]
8304 pub target_system: u8,
8305 #[doc = "Component ID."]
8306 pub target_component: u8,
8307 #[doc = "Bus number"]
8308 pub bus: u8,
8309 #[doc = "Frame length"]
8310 pub len: u8,
8311 #[doc = "Frame data"]
8312 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8313 pub data: [u8; 8],
8314}
8315impl CAN_FRAME_DATA {
8316 pub const ENCODED_LEN: usize = 16usize;
8317 pub const DEFAULT: Self = Self {
8318 id: 0_u32,
8319 target_system: 0_u8,
8320 target_component: 0_u8,
8321 bus: 0_u8,
8322 len: 0_u8,
8323 data: [0_u8; 8usize],
8324 };
8325 #[cfg(feature = "arbitrary")]
8326 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8327 use arbitrary::{Arbitrary, Unstructured};
8328 let mut buf = [0u8; 1024];
8329 rng.fill_bytes(&mut buf);
8330 let mut unstructured = Unstructured::new(&buf);
8331 Self::arbitrary(&mut unstructured).unwrap_or_default()
8332 }
8333}
8334impl Default for CAN_FRAME_DATA {
8335 fn default() -> Self {
8336 Self::DEFAULT.clone()
8337 }
8338}
8339impl MessageData for CAN_FRAME_DATA {
8340 type Message = MavMessage;
8341 const ID: u32 = 386u32;
8342 const NAME: &'static str = "CAN_FRAME";
8343 const EXTRA_CRC: u8 = 132u8;
8344 const ENCODED_LEN: usize = 16usize;
8345 fn deser(
8346 _version: MavlinkVersion,
8347 __input: &[u8],
8348 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8349 let avail_len = __input.len();
8350 let mut payload_buf = [0; Self::ENCODED_LEN];
8351 let mut buf = if avail_len < Self::ENCODED_LEN {
8352 payload_buf[0..avail_len].copy_from_slice(__input);
8353 Bytes::new(&payload_buf)
8354 } else {
8355 Bytes::new(__input)
8356 };
8357 let mut __struct = Self::default();
8358 __struct.id = buf.get_u32_le();
8359 __struct.target_system = buf.get_u8();
8360 __struct.target_component = buf.get_u8();
8361 __struct.bus = buf.get_u8();
8362 __struct.len = buf.get_u8();
8363 for v in &mut __struct.data {
8364 let val = buf.get_u8();
8365 *v = val;
8366 }
8367 Ok(__struct)
8368 }
8369 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8370 let mut __tmp = BytesMut::new(bytes);
8371 #[allow(clippy::absurd_extreme_comparisons)]
8372 #[allow(unused_comparisons)]
8373 if __tmp.remaining() < Self::ENCODED_LEN {
8374 panic!(
8375 "buffer is too small (need {} bytes, but got {})",
8376 Self::ENCODED_LEN,
8377 __tmp.remaining(),
8378 )
8379 }
8380 __tmp.put_u32_le(self.id);
8381 __tmp.put_u8(self.target_system);
8382 __tmp.put_u8(self.target_component);
8383 __tmp.put_u8(self.bus);
8384 __tmp.put_u8(self.len);
8385 for val in &self.data {
8386 __tmp.put_u8(*val);
8387 }
8388 if matches!(version, MavlinkVersion::V2) {
8389 let len = __tmp.len();
8390 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8391 } else {
8392 __tmp.len()
8393 }
8394 }
8395}
8396#[doc = "id: 336"]
8397#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8398#[derive(Debug, Clone, PartialEq)]
8399#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8400#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8401pub struct CELLULAR_CONFIG_DATA {
8402 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8403 pub enable_lte: u8,
8404 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8405 pub enable_pin: u8,
8406 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8407 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8408 pub pin: [u8; 16],
8409 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8410 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8411 pub new_pin: [u8; 16],
8412 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8413 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8414 pub apn: [u8; 32],
8415 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8416 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8417 pub puk: [u8; 16],
8418 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8419 pub roaming: u8,
8420 #[doc = "Message acceptance response (sent back to GS)."]
8421 pub response: CellularConfigResponse,
8422}
8423impl CELLULAR_CONFIG_DATA {
8424 pub const ENCODED_LEN: usize = 84usize;
8425 pub const DEFAULT: Self = Self {
8426 enable_lte: 0_u8,
8427 enable_pin: 0_u8,
8428 pin: [0_u8; 16usize],
8429 new_pin: [0_u8; 16usize],
8430 apn: [0_u8; 32usize],
8431 puk: [0_u8; 16usize],
8432 roaming: 0_u8,
8433 response: CellularConfigResponse::DEFAULT,
8434 };
8435 #[cfg(feature = "arbitrary")]
8436 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8437 use arbitrary::{Arbitrary, Unstructured};
8438 let mut buf = [0u8; 1024];
8439 rng.fill_bytes(&mut buf);
8440 let mut unstructured = Unstructured::new(&buf);
8441 Self::arbitrary(&mut unstructured).unwrap_or_default()
8442 }
8443}
8444impl Default for CELLULAR_CONFIG_DATA {
8445 fn default() -> Self {
8446 Self::DEFAULT.clone()
8447 }
8448}
8449impl MessageData for CELLULAR_CONFIG_DATA {
8450 type Message = MavMessage;
8451 const ID: u32 = 336u32;
8452 const NAME: &'static str = "CELLULAR_CONFIG";
8453 const EXTRA_CRC: u8 = 245u8;
8454 const ENCODED_LEN: usize = 84usize;
8455 fn deser(
8456 _version: MavlinkVersion,
8457 __input: &[u8],
8458 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8459 let avail_len = __input.len();
8460 let mut payload_buf = [0; Self::ENCODED_LEN];
8461 let mut buf = if avail_len < Self::ENCODED_LEN {
8462 payload_buf[0..avail_len].copy_from_slice(__input);
8463 Bytes::new(&payload_buf)
8464 } else {
8465 Bytes::new(__input)
8466 };
8467 let mut __struct = Self::default();
8468 __struct.enable_lte = buf.get_u8();
8469 __struct.enable_pin = buf.get_u8();
8470 for v in &mut __struct.pin {
8471 let val = buf.get_u8();
8472 *v = val;
8473 }
8474 for v in &mut __struct.new_pin {
8475 let val = buf.get_u8();
8476 *v = val;
8477 }
8478 for v in &mut __struct.apn {
8479 let val = buf.get_u8();
8480 *v = val;
8481 }
8482 for v in &mut __struct.puk {
8483 let val = buf.get_u8();
8484 *v = val;
8485 }
8486 __struct.roaming = buf.get_u8();
8487 let tmp = buf.get_u8();
8488 __struct.response =
8489 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8490 enum_type: "CellularConfigResponse",
8491 value: tmp as u32,
8492 })?;
8493 Ok(__struct)
8494 }
8495 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8496 let mut __tmp = BytesMut::new(bytes);
8497 #[allow(clippy::absurd_extreme_comparisons)]
8498 #[allow(unused_comparisons)]
8499 if __tmp.remaining() < Self::ENCODED_LEN {
8500 panic!(
8501 "buffer is too small (need {} bytes, but got {})",
8502 Self::ENCODED_LEN,
8503 __tmp.remaining(),
8504 )
8505 }
8506 __tmp.put_u8(self.enable_lte);
8507 __tmp.put_u8(self.enable_pin);
8508 for val in &self.pin {
8509 __tmp.put_u8(*val);
8510 }
8511 for val in &self.new_pin {
8512 __tmp.put_u8(*val);
8513 }
8514 for val in &self.apn {
8515 __tmp.put_u8(*val);
8516 }
8517 for val in &self.puk {
8518 __tmp.put_u8(*val);
8519 }
8520 __tmp.put_u8(self.roaming);
8521 __tmp.put_u8(self.response as u8);
8522 if matches!(version, MavlinkVersion::V2) {
8523 let len = __tmp.len();
8524 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8525 } else {
8526 __tmp.len()
8527 }
8528 }
8529}
8530#[doc = "id: 334"]
8531#[doc = "Report current used cellular network status."]
8532#[derive(Debug, Clone, PartialEq)]
8533#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8535pub struct CELLULAR_STATUS_DATA {
8536 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8537 pub mcc: u16,
8538 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8539 pub mnc: u16,
8540 #[doc = "Location area code. If unknown, set to 0"]
8541 pub lac: u16,
8542 #[doc = "Cellular modem status"]
8543 pub status: CellularStatusFlag,
8544 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8545 pub failure_reason: CellularNetworkFailedReason,
8546 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8547 pub mavtype: CellularNetworkRadioType,
8548 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8549 pub quality: u8,
8550}
8551impl CELLULAR_STATUS_DATA {
8552 pub const ENCODED_LEN: usize = 10usize;
8553 pub const DEFAULT: Self = Self {
8554 mcc: 0_u16,
8555 mnc: 0_u16,
8556 lac: 0_u16,
8557 status: CellularStatusFlag::DEFAULT,
8558 failure_reason: CellularNetworkFailedReason::DEFAULT,
8559 mavtype: CellularNetworkRadioType::DEFAULT,
8560 quality: 0_u8,
8561 };
8562 #[cfg(feature = "arbitrary")]
8563 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8564 use arbitrary::{Arbitrary, Unstructured};
8565 let mut buf = [0u8; 1024];
8566 rng.fill_bytes(&mut buf);
8567 let mut unstructured = Unstructured::new(&buf);
8568 Self::arbitrary(&mut unstructured).unwrap_or_default()
8569 }
8570}
8571impl Default for CELLULAR_STATUS_DATA {
8572 fn default() -> Self {
8573 Self::DEFAULT.clone()
8574 }
8575}
8576impl MessageData for CELLULAR_STATUS_DATA {
8577 type Message = MavMessage;
8578 const ID: u32 = 334u32;
8579 const NAME: &'static str = "CELLULAR_STATUS";
8580 const EXTRA_CRC: u8 = 72u8;
8581 const ENCODED_LEN: usize = 10usize;
8582 fn deser(
8583 _version: MavlinkVersion,
8584 __input: &[u8],
8585 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8586 let avail_len = __input.len();
8587 let mut payload_buf = [0; Self::ENCODED_LEN];
8588 let mut buf = if avail_len < Self::ENCODED_LEN {
8589 payload_buf[0..avail_len].copy_from_slice(__input);
8590 Bytes::new(&payload_buf)
8591 } else {
8592 Bytes::new(__input)
8593 };
8594 let mut __struct = Self::default();
8595 __struct.mcc = buf.get_u16_le();
8596 __struct.mnc = buf.get_u16_le();
8597 __struct.lac = buf.get_u16_le();
8598 let tmp = buf.get_u8();
8599 __struct.status =
8600 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8601 enum_type: "CellularStatusFlag",
8602 value: tmp as u32,
8603 })?;
8604 let tmp = buf.get_u8();
8605 __struct.failure_reason =
8606 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8607 enum_type: "CellularNetworkFailedReason",
8608 value: tmp as u32,
8609 })?;
8610 let tmp = buf.get_u8();
8611 __struct.mavtype =
8612 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8613 enum_type: "CellularNetworkRadioType",
8614 value: tmp as u32,
8615 })?;
8616 __struct.quality = buf.get_u8();
8617 Ok(__struct)
8618 }
8619 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8620 let mut __tmp = BytesMut::new(bytes);
8621 #[allow(clippy::absurd_extreme_comparisons)]
8622 #[allow(unused_comparisons)]
8623 if __tmp.remaining() < Self::ENCODED_LEN {
8624 panic!(
8625 "buffer is too small (need {} bytes, but got {})",
8626 Self::ENCODED_LEN,
8627 __tmp.remaining(),
8628 )
8629 }
8630 __tmp.put_u16_le(self.mcc);
8631 __tmp.put_u16_le(self.mnc);
8632 __tmp.put_u16_le(self.lac);
8633 __tmp.put_u8(self.status as u8);
8634 __tmp.put_u8(self.failure_reason as u8);
8635 __tmp.put_u8(self.mavtype as u8);
8636 __tmp.put_u8(self.quality);
8637 if matches!(version, MavlinkVersion::V2) {
8638 let len = __tmp.len();
8639 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8640 } else {
8641 __tmp.len()
8642 }
8643 }
8644}
8645#[doc = "id: 5"]
8646#[doc = "Request to control this MAV."]
8647#[derive(Debug, Clone, PartialEq)]
8648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8649#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8650pub struct CHANGE_OPERATOR_CONTROL_DATA {
8651 #[doc = "System the GCS requests control for"]
8652 pub target_system: u8,
8653 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8654 pub control_request: u8,
8655 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8656 pub version: u8,
8657 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8658 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8659 pub passkey: [u8; 25],
8660}
8661impl CHANGE_OPERATOR_CONTROL_DATA {
8662 pub const ENCODED_LEN: usize = 28usize;
8663 pub const DEFAULT: Self = Self {
8664 target_system: 0_u8,
8665 control_request: 0_u8,
8666 version: 0_u8,
8667 passkey: [0_u8; 25usize],
8668 };
8669 #[cfg(feature = "arbitrary")]
8670 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8671 use arbitrary::{Arbitrary, Unstructured};
8672 let mut buf = [0u8; 1024];
8673 rng.fill_bytes(&mut buf);
8674 let mut unstructured = Unstructured::new(&buf);
8675 Self::arbitrary(&mut unstructured).unwrap_or_default()
8676 }
8677}
8678impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8679 fn default() -> Self {
8680 Self::DEFAULT.clone()
8681 }
8682}
8683impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8684 type Message = MavMessage;
8685 const ID: u32 = 5u32;
8686 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8687 const EXTRA_CRC: u8 = 217u8;
8688 const ENCODED_LEN: usize = 28usize;
8689 fn deser(
8690 _version: MavlinkVersion,
8691 __input: &[u8],
8692 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8693 let avail_len = __input.len();
8694 let mut payload_buf = [0; Self::ENCODED_LEN];
8695 let mut buf = if avail_len < Self::ENCODED_LEN {
8696 payload_buf[0..avail_len].copy_from_slice(__input);
8697 Bytes::new(&payload_buf)
8698 } else {
8699 Bytes::new(__input)
8700 };
8701 let mut __struct = Self::default();
8702 __struct.target_system = buf.get_u8();
8703 __struct.control_request = buf.get_u8();
8704 __struct.version = buf.get_u8();
8705 for v in &mut __struct.passkey {
8706 let val = buf.get_u8();
8707 *v = val;
8708 }
8709 Ok(__struct)
8710 }
8711 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8712 let mut __tmp = BytesMut::new(bytes);
8713 #[allow(clippy::absurd_extreme_comparisons)]
8714 #[allow(unused_comparisons)]
8715 if __tmp.remaining() < Self::ENCODED_LEN {
8716 panic!(
8717 "buffer is too small (need {} bytes, but got {})",
8718 Self::ENCODED_LEN,
8719 __tmp.remaining(),
8720 )
8721 }
8722 __tmp.put_u8(self.target_system);
8723 __tmp.put_u8(self.control_request);
8724 __tmp.put_u8(self.version);
8725 for val in &self.passkey {
8726 __tmp.put_u8(*val);
8727 }
8728 if matches!(version, MavlinkVersion::V2) {
8729 let len = __tmp.len();
8730 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8731 } else {
8732 __tmp.len()
8733 }
8734 }
8735}
8736#[doc = "id: 6"]
8737#[doc = "Accept / deny control of this MAV."]
8738#[derive(Debug, Clone, PartialEq)]
8739#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8740#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8741pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8742 #[doc = "ID of the GCS this message"]
8743 pub gcs_system_id: u8,
8744 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8745 pub control_request: u8,
8746 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8747 pub ack: u8,
8748}
8749impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8750 pub const ENCODED_LEN: usize = 3usize;
8751 pub const DEFAULT: Self = Self {
8752 gcs_system_id: 0_u8,
8753 control_request: 0_u8,
8754 ack: 0_u8,
8755 };
8756 #[cfg(feature = "arbitrary")]
8757 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8758 use arbitrary::{Arbitrary, Unstructured};
8759 let mut buf = [0u8; 1024];
8760 rng.fill_bytes(&mut buf);
8761 let mut unstructured = Unstructured::new(&buf);
8762 Self::arbitrary(&mut unstructured).unwrap_or_default()
8763 }
8764}
8765impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8766 fn default() -> Self {
8767 Self::DEFAULT.clone()
8768 }
8769}
8770impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8771 type Message = MavMessage;
8772 const ID: u32 = 6u32;
8773 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8774 const EXTRA_CRC: u8 = 104u8;
8775 const ENCODED_LEN: usize = 3usize;
8776 fn deser(
8777 _version: MavlinkVersion,
8778 __input: &[u8],
8779 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8780 let avail_len = __input.len();
8781 let mut payload_buf = [0; Self::ENCODED_LEN];
8782 let mut buf = if avail_len < Self::ENCODED_LEN {
8783 payload_buf[0..avail_len].copy_from_slice(__input);
8784 Bytes::new(&payload_buf)
8785 } else {
8786 Bytes::new(__input)
8787 };
8788 let mut __struct = Self::default();
8789 __struct.gcs_system_id = buf.get_u8();
8790 __struct.control_request = buf.get_u8();
8791 __struct.ack = buf.get_u8();
8792 Ok(__struct)
8793 }
8794 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8795 let mut __tmp = BytesMut::new(bytes);
8796 #[allow(clippy::absurd_extreme_comparisons)]
8797 #[allow(unused_comparisons)]
8798 if __tmp.remaining() < Self::ENCODED_LEN {
8799 panic!(
8800 "buffer is too small (need {} bytes, but got {})",
8801 Self::ENCODED_LEN,
8802 __tmp.remaining(),
8803 )
8804 }
8805 __tmp.put_u8(self.gcs_system_id);
8806 __tmp.put_u8(self.control_request);
8807 __tmp.put_u8(self.ack);
8808 if matches!(version, MavlinkVersion::V2) {
8809 let len = __tmp.len();
8810 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8811 } else {
8812 __tmp.len()
8813 }
8814 }
8815}
8816#[doc = "id: 247"]
8817#[doc = "Information about a potential collision."]
8818#[derive(Debug, Clone, PartialEq)]
8819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8821pub struct COLLISION_DATA {
8822 #[doc = "Unique identifier, domain based on src field"]
8823 pub id: u32,
8824 #[doc = "Estimated time until collision occurs"]
8825 pub time_to_minimum_delta: f32,
8826 #[doc = "Closest vertical distance between vehicle and object"]
8827 pub altitude_minimum_delta: f32,
8828 #[doc = "Closest horizontal distance between vehicle and object"]
8829 pub horizontal_minimum_delta: f32,
8830 #[doc = "Collision data source"]
8831 pub src: MavCollisionSrc,
8832 #[doc = "Action that is being taken to avoid this collision"]
8833 pub action: MavCollisionAction,
8834 #[doc = "How concerned the aircraft is about this collision"]
8835 pub threat_level: MavCollisionThreatLevel,
8836}
8837impl COLLISION_DATA {
8838 pub const ENCODED_LEN: usize = 19usize;
8839 pub const DEFAULT: Self = Self {
8840 id: 0_u32,
8841 time_to_minimum_delta: 0.0_f32,
8842 altitude_minimum_delta: 0.0_f32,
8843 horizontal_minimum_delta: 0.0_f32,
8844 src: MavCollisionSrc::DEFAULT,
8845 action: MavCollisionAction::DEFAULT,
8846 threat_level: MavCollisionThreatLevel::DEFAULT,
8847 };
8848 #[cfg(feature = "arbitrary")]
8849 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8850 use arbitrary::{Arbitrary, Unstructured};
8851 let mut buf = [0u8; 1024];
8852 rng.fill_bytes(&mut buf);
8853 let mut unstructured = Unstructured::new(&buf);
8854 Self::arbitrary(&mut unstructured).unwrap_or_default()
8855 }
8856}
8857impl Default for COLLISION_DATA {
8858 fn default() -> Self {
8859 Self::DEFAULT.clone()
8860 }
8861}
8862impl MessageData for COLLISION_DATA {
8863 type Message = MavMessage;
8864 const ID: u32 = 247u32;
8865 const NAME: &'static str = "COLLISION";
8866 const EXTRA_CRC: u8 = 81u8;
8867 const ENCODED_LEN: usize = 19usize;
8868 fn deser(
8869 _version: MavlinkVersion,
8870 __input: &[u8],
8871 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8872 let avail_len = __input.len();
8873 let mut payload_buf = [0; Self::ENCODED_LEN];
8874 let mut buf = if avail_len < Self::ENCODED_LEN {
8875 payload_buf[0..avail_len].copy_from_slice(__input);
8876 Bytes::new(&payload_buf)
8877 } else {
8878 Bytes::new(__input)
8879 };
8880 let mut __struct = Self::default();
8881 __struct.id = buf.get_u32_le();
8882 __struct.time_to_minimum_delta = buf.get_f32_le();
8883 __struct.altitude_minimum_delta = buf.get_f32_le();
8884 __struct.horizontal_minimum_delta = buf.get_f32_le();
8885 let tmp = buf.get_u8();
8886 __struct.src =
8887 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8888 enum_type: "MavCollisionSrc",
8889 value: tmp as u32,
8890 })?;
8891 let tmp = buf.get_u8();
8892 __struct.action =
8893 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8894 enum_type: "MavCollisionAction",
8895 value: tmp as u32,
8896 })?;
8897 let tmp = buf.get_u8();
8898 __struct.threat_level =
8899 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8900 enum_type: "MavCollisionThreatLevel",
8901 value: tmp as u32,
8902 })?;
8903 Ok(__struct)
8904 }
8905 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8906 let mut __tmp = BytesMut::new(bytes);
8907 #[allow(clippy::absurd_extreme_comparisons)]
8908 #[allow(unused_comparisons)]
8909 if __tmp.remaining() < Self::ENCODED_LEN {
8910 panic!(
8911 "buffer is too small (need {} bytes, but got {})",
8912 Self::ENCODED_LEN,
8913 __tmp.remaining(),
8914 )
8915 }
8916 __tmp.put_u32_le(self.id);
8917 __tmp.put_f32_le(self.time_to_minimum_delta);
8918 __tmp.put_f32_le(self.altitude_minimum_delta);
8919 __tmp.put_f32_le(self.horizontal_minimum_delta);
8920 __tmp.put_u8(self.src as u8);
8921 __tmp.put_u8(self.action as u8);
8922 __tmp.put_u8(self.threat_level as u8);
8923 if matches!(version, MavlinkVersion::V2) {
8924 let len = __tmp.len();
8925 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8926 } else {
8927 __tmp.len()
8928 }
8929 }
8930}
8931#[doc = "id: 77"]
8932#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8933#[derive(Debug, Clone, PartialEq)]
8934#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8935#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8936pub struct COMMAND_ACK_DATA {
8937 #[doc = "Command ID (of acknowledged command)."]
8938 pub command: MavCmd,
8939 #[doc = "Result of command."]
8940 pub result: MavResult,
8941 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8942 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8943 pub progress: u8,
8944 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8945 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8946 pub result_param2: i32,
8947 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8948 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8949 pub target_system: u8,
8950 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8951 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8952 pub target_component: u8,
8953}
8954impl COMMAND_ACK_DATA {
8955 pub const ENCODED_LEN: usize = 10usize;
8956 pub const DEFAULT: Self = Self {
8957 command: MavCmd::DEFAULT,
8958 result: MavResult::DEFAULT,
8959 progress: 0_u8,
8960 result_param2: 0_i32,
8961 target_system: 0_u8,
8962 target_component: 0_u8,
8963 };
8964 #[cfg(feature = "arbitrary")]
8965 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8966 use arbitrary::{Arbitrary, Unstructured};
8967 let mut buf = [0u8; 1024];
8968 rng.fill_bytes(&mut buf);
8969 let mut unstructured = Unstructured::new(&buf);
8970 Self::arbitrary(&mut unstructured).unwrap_or_default()
8971 }
8972}
8973impl Default for COMMAND_ACK_DATA {
8974 fn default() -> Self {
8975 Self::DEFAULT.clone()
8976 }
8977}
8978impl MessageData for COMMAND_ACK_DATA {
8979 type Message = MavMessage;
8980 const ID: u32 = 77u32;
8981 const NAME: &'static str = "COMMAND_ACK";
8982 const EXTRA_CRC: u8 = 143u8;
8983 const ENCODED_LEN: usize = 10usize;
8984 fn deser(
8985 _version: MavlinkVersion,
8986 __input: &[u8],
8987 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8988 let avail_len = __input.len();
8989 let mut payload_buf = [0; Self::ENCODED_LEN];
8990 let mut buf = if avail_len < Self::ENCODED_LEN {
8991 payload_buf[0..avail_len].copy_from_slice(__input);
8992 Bytes::new(&payload_buf)
8993 } else {
8994 Bytes::new(__input)
8995 };
8996 let mut __struct = Self::default();
8997 let tmp = buf.get_u16_le();
8998 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8999 ::mavlink_core::error::ParserError::InvalidEnum {
9000 enum_type: "MavCmd",
9001 value: tmp as u32,
9002 },
9003 )?;
9004 let tmp = buf.get_u8();
9005 __struct.result =
9006 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9007 enum_type: "MavResult",
9008 value: tmp as u32,
9009 })?;
9010 __struct.progress = buf.get_u8();
9011 __struct.result_param2 = buf.get_i32_le();
9012 __struct.target_system = buf.get_u8();
9013 __struct.target_component = buf.get_u8();
9014 Ok(__struct)
9015 }
9016 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9017 let mut __tmp = BytesMut::new(bytes);
9018 #[allow(clippy::absurd_extreme_comparisons)]
9019 #[allow(unused_comparisons)]
9020 if __tmp.remaining() < Self::ENCODED_LEN {
9021 panic!(
9022 "buffer is too small (need {} bytes, but got {})",
9023 Self::ENCODED_LEN,
9024 __tmp.remaining(),
9025 )
9026 }
9027 __tmp.put_u16_le(self.command as u16);
9028 __tmp.put_u8(self.result as u8);
9029 __tmp.put_u8(self.progress);
9030 __tmp.put_i32_le(self.result_param2);
9031 __tmp.put_u8(self.target_system);
9032 __tmp.put_u8(self.target_component);
9033 if matches!(version, MavlinkVersion::V2) {
9034 let len = __tmp.len();
9035 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9036 } else {
9037 __tmp.len()
9038 }
9039 }
9040}
9041#[doc = "id: 80"]
9042#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9043#[derive(Debug, Clone, PartialEq)]
9044#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9045#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9046pub struct COMMAND_CANCEL_DATA {
9047 #[doc = "Command ID (of command to cancel)."]
9048 pub command: MavCmd,
9049 #[doc = "System executing long running command. Should not be broadcast (0)."]
9050 pub target_system: u8,
9051 #[doc = "Component executing long running command."]
9052 pub target_component: u8,
9053}
9054impl COMMAND_CANCEL_DATA {
9055 pub const ENCODED_LEN: usize = 4usize;
9056 pub const DEFAULT: Self = Self {
9057 command: MavCmd::DEFAULT,
9058 target_system: 0_u8,
9059 target_component: 0_u8,
9060 };
9061 #[cfg(feature = "arbitrary")]
9062 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9063 use arbitrary::{Arbitrary, Unstructured};
9064 let mut buf = [0u8; 1024];
9065 rng.fill_bytes(&mut buf);
9066 let mut unstructured = Unstructured::new(&buf);
9067 Self::arbitrary(&mut unstructured).unwrap_or_default()
9068 }
9069}
9070impl Default for COMMAND_CANCEL_DATA {
9071 fn default() -> Self {
9072 Self::DEFAULT.clone()
9073 }
9074}
9075impl MessageData for COMMAND_CANCEL_DATA {
9076 type Message = MavMessage;
9077 const ID: u32 = 80u32;
9078 const NAME: &'static str = "COMMAND_CANCEL";
9079 const EXTRA_CRC: u8 = 14u8;
9080 const ENCODED_LEN: usize = 4usize;
9081 fn deser(
9082 _version: MavlinkVersion,
9083 __input: &[u8],
9084 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9085 let avail_len = __input.len();
9086 let mut payload_buf = [0; Self::ENCODED_LEN];
9087 let mut buf = if avail_len < Self::ENCODED_LEN {
9088 payload_buf[0..avail_len].copy_from_slice(__input);
9089 Bytes::new(&payload_buf)
9090 } else {
9091 Bytes::new(__input)
9092 };
9093 let mut __struct = Self::default();
9094 let tmp = buf.get_u16_le();
9095 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9096 ::mavlink_core::error::ParserError::InvalidEnum {
9097 enum_type: "MavCmd",
9098 value: tmp as u32,
9099 },
9100 )?;
9101 __struct.target_system = buf.get_u8();
9102 __struct.target_component = buf.get_u8();
9103 Ok(__struct)
9104 }
9105 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9106 let mut __tmp = BytesMut::new(bytes);
9107 #[allow(clippy::absurd_extreme_comparisons)]
9108 #[allow(unused_comparisons)]
9109 if __tmp.remaining() < Self::ENCODED_LEN {
9110 panic!(
9111 "buffer is too small (need {} bytes, but got {})",
9112 Self::ENCODED_LEN,
9113 __tmp.remaining(),
9114 )
9115 }
9116 __tmp.put_u16_le(self.command as u16);
9117 __tmp.put_u8(self.target_system);
9118 __tmp.put_u8(self.target_component);
9119 if matches!(version, MavlinkVersion::V2) {
9120 let len = __tmp.len();
9121 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9122 } else {
9123 __tmp.len()
9124 }
9125 }
9126}
9127#[doc = "id: 75"]
9128#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9129#[derive(Debug, Clone, PartialEq)]
9130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9131#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9132pub struct COMMAND_INT_DATA {
9133 #[doc = "PARAM1, see MAV_CMD enum"]
9134 pub param1: f32,
9135 #[doc = "PARAM2, see MAV_CMD enum"]
9136 pub param2: f32,
9137 #[doc = "PARAM3, see MAV_CMD enum"]
9138 pub param3: f32,
9139 #[doc = "PARAM4, see MAV_CMD enum"]
9140 pub param4: f32,
9141 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9142 pub x: i32,
9143 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9144 pub y: i32,
9145 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9146 pub z: f32,
9147 #[doc = "The scheduled action for the mission item."]
9148 pub command: MavCmd,
9149 #[doc = "System ID"]
9150 pub target_system: u8,
9151 #[doc = "Component ID"]
9152 pub target_component: u8,
9153 #[doc = "The coordinate system of the COMMAND."]
9154 pub frame: MavFrame,
9155 #[doc = "Not used."]
9156 pub current: u8,
9157 #[doc = "Not used (set 0)."]
9158 pub autocontinue: u8,
9159}
9160impl COMMAND_INT_DATA {
9161 pub const ENCODED_LEN: usize = 35usize;
9162 pub const DEFAULT: Self = Self {
9163 param1: 0.0_f32,
9164 param2: 0.0_f32,
9165 param3: 0.0_f32,
9166 param4: 0.0_f32,
9167 x: 0_i32,
9168 y: 0_i32,
9169 z: 0.0_f32,
9170 command: MavCmd::DEFAULT,
9171 target_system: 0_u8,
9172 target_component: 0_u8,
9173 frame: MavFrame::DEFAULT,
9174 current: 0_u8,
9175 autocontinue: 0_u8,
9176 };
9177 #[cfg(feature = "arbitrary")]
9178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9179 use arbitrary::{Arbitrary, Unstructured};
9180 let mut buf = [0u8; 1024];
9181 rng.fill_bytes(&mut buf);
9182 let mut unstructured = Unstructured::new(&buf);
9183 Self::arbitrary(&mut unstructured).unwrap_or_default()
9184 }
9185}
9186impl Default for COMMAND_INT_DATA {
9187 fn default() -> Self {
9188 Self::DEFAULT.clone()
9189 }
9190}
9191impl MessageData for COMMAND_INT_DATA {
9192 type Message = MavMessage;
9193 const ID: u32 = 75u32;
9194 const NAME: &'static str = "COMMAND_INT";
9195 const EXTRA_CRC: u8 = 158u8;
9196 const ENCODED_LEN: usize = 35usize;
9197 fn deser(
9198 _version: MavlinkVersion,
9199 __input: &[u8],
9200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9201 let avail_len = __input.len();
9202 let mut payload_buf = [0; Self::ENCODED_LEN];
9203 let mut buf = if avail_len < Self::ENCODED_LEN {
9204 payload_buf[0..avail_len].copy_from_slice(__input);
9205 Bytes::new(&payload_buf)
9206 } else {
9207 Bytes::new(__input)
9208 };
9209 let mut __struct = Self::default();
9210 __struct.param1 = buf.get_f32_le();
9211 __struct.param2 = buf.get_f32_le();
9212 __struct.param3 = buf.get_f32_le();
9213 __struct.param4 = buf.get_f32_le();
9214 __struct.x = buf.get_i32_le();
9215 __struct.y = buf.get_i32_le();
9216 __struct.z = buf.get_f32_le();
9217 let tmp = buf.get_u16_le();
9218 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9219 ::mavlink_core::error::ParserError::InvalidEnum {
9220 enum_type: "MavCmd",
9221 value: tmp as u32,
9222 },
9223 )?;
9224 __struct.target_system = buf.get_u8();
9225 __struct.target_component = buf.get_u8();
9226 let tmp = buf.get_u8();
9227 __struct.frame =
9228 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9229 enum_type: "MavFrame",
9230 value: tmp as u32,
9231 })?;
9232 __struct.current = buf.get_u8();
9233 __struct.autocontinue = buf.get_u8();
9234 Ok(__struct)
9235 }
9236 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9237 let mut __tmp = BytesMut::new(bytes);
9238 #[allow(clippy::absurd_extreme_comparisons)]
9239 #[allow(unused_comparisons)]
9240 if __tmp.remaining() < Self::ENCODED_LEN {
9241 panic!(
9242 "buffer is too small (need {} bytes, but got {})",
9243 Self::ENCODED_LEN,
9244 __tmp.remaining(),
9245 )
9246 }
9247 __tmp.put_f32_le(self.param1);
9248 __tmp.put_f32_le(self.param2);
9249 __tmp.put_f32_le(self.param3);
9250 __tmp.put_f32_le(self.param4);
9251 __tmp.put_i32_le(self.x);
9252 __tmp.put_i32_le(self.y);
9253 __tmp.put_f32_le(self.z);
9254 __tmp.put_u16_le(self.command as u16);
9255 __tmp.put_u8(self.target_system);
9256 __tmp.put_u8(self.target_component);
9257 __tmp.put_u8(self.frame as u8);
9258 __tmp.put_u8(self.current);
9259 __tmp.put_u8(self.autocontinue);
9260 if matches!(version, MavlinkVersion::V2) {
9261 let len = __tmp.len();
9262 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9263 } else {
9264 __tmp.len()
9265 }
9266 }
9267}
9268#[doc = "id: 76"]
9269#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9270#[derive(Debug, Clone, PartialEq)]
9271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9273pub struct COMMAND_LONG_DATA {
9274 #[doc = "Parameter 1 (for the specific command)."]
9275 pub param1: f32,
9276 #[doc = "Parameter 2 (for the specific command)."]
9277 pub param2: f32,
9278 #[doc = "Parameter 3 (for the specific command)."]
9279 pub param3: f32,
9280 #[doc = "Parameter 4 (for the specific command)."]
9281 pub param4: f32,
9282 #[doc = "Parameter 5 (for the specific command)."]
9283 pub param5: f32,
9284 #[doc = "Parameter 6 (for the specific command)."]
9285 pub param6: f32,
9286 #[doc = "Parameter 7 (for the specific command)."]
9287 pub param7: f32,
9288 #[doc = "Command ID (of command to send)."]
9289 pub command: MavCmd,
9290 #[doc = "System which should execute the command"]
9291 pub target_system: u8,
9292 #[doc = "Component which should execute the command, 0 for all components"]
9293 pub target_component: u8,
9294 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9295 pub confirmation: u8,
9296}
9297impl COMMAND_LONG_DATA {
9298 pub const ENCODED_LEN: usize = 33usize;
9299 pub const DEFAULT: Self = Self {
9300 param1: 0.0_f32,
9301 param2: 0.0_f32,
9302 param3: 0.0_f32,
9303 param4: 0.0_f32,
9304 param5: 0.0_f32,
9305 param6: 0.0_f32,
9306 param7: 0.0_f32,
9307 command: MavCmd::DEFAULT,
9308 target_system: 0_u8,
9309 target_component: 0_u8,
9310 confirmation: 0_u8,
9311 };
9312 #[cfg(feature = "arbitrary")]
9313 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9314 use arbitrary::{Arbitrary, Unstructured};
9315 let mut buf = [0u8; 1024];
9316 rng.fill_bytes(&mut buf);
9317 let mut unstructured = Unstructured::new(&buf);
9318 Self::arbitrary(&mut unstructured).unwrap_or_default()
9319 }
9320}
9321impl Default for COMMAND_LONG_DATA {
9322 fn default() -> Self {
9323 Self::DEFAULT.clone()
9324 }
9325}
9326impl MessageData for COMMAND_LONG_DATA {
9327 type Message = MavMessage;
9328 const ID: u32 = 76u32;
9329 const NAME: &'static str = "COMMAND_LONG";
9330 const EXTRA_CRC: u8 = 152u8;
9331 const ENCODED_LEN: usize = 33usize;
9332 fn deser(
9333 _version: MavlinkVersion,
9334 __input: &[u8],
9335 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9336 let avail_len = __input.len();
9337 let mut payload_buf = [0; Self::ENCODED_LEN];
9338 let mut buf = if avail_len < Self::ENCODED_LEN {
9339 payload_buf[0..avail_len].copy_from_slice(__input);
9340 Bytes::new(&payload_buf)
9341 } else {
9342 Bytes::new(__input)
9343 };
9344 let mut __struct = Self::default();
9345 __struct.param1 = buf.get_f32_le();
9346 __struct.param2 = buf.get_f32_le();
9347 __struct.param3 = buf.get_f32_le();
9348 __struct.param4 = buf.get_f32_le();
9349 __struct.param5 = buf.get_f32_le();
9350 __struct.param6 = buf.get_f32_le();
9351 __struct.param7 = buf.get_f32_le();
9352 let tmp = buf.get_u16_le();
9353 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9354 ::mavlink_core::error::ParserError::InvalidEnum {
9355 enum_type: "MavCmd",
9356 value: tmp as u32,
9357 },
9358 )?;
9359 __struct.target_system = buf.get_u8();
9360 __struct.target_component = buf.get_u8();
9361 __struct.confirmation = buf.get_u8();
9362 Ok(__struct)
9363 }
9364 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9365 let mut __tmp = BytesMut::new(bytes);
9366 #[allow(clippy::absurd_extreme_comparisons)]
9367 #[allow(unused_comparisons)]
9368 if __tmp.remaining() < Self::ENCODED_LEN {
9369 panic!(
9370 "buffer is too small (need {} bytes, but got {})",
9371 Self::ENCODED_LEN,
9372 __tmp.remaining(),
9373 )
9374 }
9375 __tmp.put_f32_le(self.param1);
9376 __tmp.put_f32_le(self.param2);
9377 __tmp.put_f32_le(self.param3);
9378 __tmp.put_f32_le(self.param4);
9379 __tmp.put_f32_le(self.param5);
9380 __tmp.put_f32_le(self.param6);
9381 __tmp.put_f32_le(self.param7);
9382 __tmp.put_u16_le(self.command as u16);
9383 __tmp.put_u8(self.target_system);
9384 __tmp.put_u8(self.target_component);
9385 __tmp.put_u8(self.confirmation);
9386 if matches!(version, MavlinkVersion::V2) {
9387 let len = __tmp.len();
9388 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9389 } else {
9390 __tmp.len()
9391 }
9392 }
9393}
9394#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9395#[doc = "id: 395"]
9396#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9397#[derive(Debug, Clone, PartialEq)]
9398#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9399#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9400pub struct COMPONENT_INFORMATION_DATA {
9401 #[doc = "Timestamp (time since system boot)."]
9402 pub time_boot_ms: u32,
9403 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9404 pub general_metadata_file_crc: u32,
9405 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9406 pub peripherals_metadata_file_crc: u32,
9407 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9408 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9409 pub general_metadata_uri: [u8; 100],
9410 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9411 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9412 pub peripherals_metadata_uri: [u8; 100],
9413}
9414impl COMPONENT_INFORMATION_DATA {
9415 pub const ENCODED_LEN: usize = 212usize;
9416 pub const DEFAULT: Self = Self {
9417 time_boot_ms: 0_u32,
9418 general_metadata_file_crc: 0_u32,
9419 peripherals_metadata_file_crc: 0_u32,
9420 general_metadata_uri: [0_u8; 100usize],
9421 peripherals_metadata_uri: [0_u8; 100usize],
9422 };
9423 #[cfg(feature = "arbitrary")]
9424 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9425 use arbitrary::{Arbitrary, Unstructured};
9426 let mut buf = [0u8; 1024];
9427 rng.fill_bytes(&mut buf);
9428 let mut unstructured = Unstructured::new(&buf);
9429 Self::arbitrary(&mut unstructured).unwrap_or_default()
9430 }
9431}
9432impl Default for COMPONENT_INFORMATION_DATA {
9433 fn default() -> Self {
9434 Self::DEFAULT.clone()
9435 }
9436}
9437impl MessageData for COMPONENT_INFORMATION_DATA {
9438 type Message = MavMessage;
9439 const ID: u32 = 395u32;
9440 const NAME: &'static str = "COMPONENT_INFORMATION";
9441 const EXTRA_CRC: u8 = 0u8;
9442 const ENCODED_LEN: usize = 212usize;
9443 fn deser(
9444 _version: MavlinkVersion,
9445 __input: &[u8],
9446 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9447 let avail_len = __input.len();
9448 let mut payload_buf = [0; Self::ENCODED_LEN];
9449 let mut buf = if avail_len < Self::ENCODED_LEN {
9450 payload_buf[0..avail_len].copy_from_slice(__input);
9451 Bytes::new(&payload_buf)
9452 } else {
9453 Bytes::new(__input)
9454 };
9455 let mut __struct = Self::default();
9456 __struct.time_boot_ms = buf.get_u32_le();
9457 __struct.general_metadata_file_crc = buf.get_u32_le();
9458 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9459 for v in &mut __struct.general_metadata_uri {
9460 let val = buf.get_u8();
9461 *v = val;
9462 }
9463 for v in &mut __struct.peripherals_metadata_uri {
9464 let val = buf.get_u8();
9465 *v = val;
9466 }
9467 Ok(__struct)
9468 }
9469 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9470 let mut __tmp = BytesMut::new(bytes);
9471 #[allow(clippy::absurd_extreme_comparisons)]
9472 #[allow(unused_comparisons)]
9473 if __tmp.remaining() < Self::ENCODED_LEN {
9474 panic!(
9475 "buffer is too small (need {} bytes, but got {})",
9476 Self::ENCODED_LEN,
9477 __tmp.remaining(),
9478 )
9479 }
9480 __tmp.put_u32_le(self.time_boot_ms);
9481 __tmp.put_u32_le(self.general_metadata_file_crc);
9482 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9483 for val in &self.general_metadata_uri {
9484 __tmp.put_u8(*val);
9485 }
9486 for val in &self.peripherals_metadata_uri {
9487 __tmp.put_u8(*val);
9488 }
9489 if matches!(version, MavlinkVersion::V2) {
9490 let len = __tmp.len();
9491 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9492 } else {
9493 __tmp.len()
9494 }
9495 }
9496}
9497#[doc = "id: 396"]
9498#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9499#[derive(Debug, Clone, PartialEq)]
9500#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9501#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9502pub struct COMPONENT_INFORMATION_BASIC_DATA {
9503 #[doc = "Component capability flags"]
9504 pub capabilities: MavProtocolCapability,
9505 #[doc = "Timestamp (time since system boot)."]
9506 pub time_boot_ms: u32,
9507 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9508 pub time_manufacture_s: u32,
9509 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9510 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9511 pub vendor_name: [u8; 32],
9512 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9513 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9514 pub model_name: [u8; 32],
9515 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9516 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9517 pub software_version: [u8; 24],
9518 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9519 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9520 pub hardware_version: [u8; 24],
9521 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9522 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9523 pub serial_number: [u8; 32],
9524}
9525impl COMPONENT_INFORMATION_BASIC_DATA {
9526 pub const ENCODED_LEN: usize = 160usize;
9527 pub const DEFAULT: Self = Self {
9528 capabilities: MavProtocolCapability::DEFAULT,
9529 time_boot_ms: 0_u32,
9530 time_manufacture_s: 0_u32,
9531 vendor_name: [0_u8; 32usize],
9532 model_name: [0_u8; 32usize],
9533 software_version: [0_u8; 24usize],
9534 hardware_version: [0_u8; 24usize],
9535 serial_number: [0_u8; 32usize],
9536 };
9537 #[cfg(feature = "arbitrary")]
9538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9539 use arbitrary::{Arbitrary, Unstructured};
9540 let mut buf = [0u8; 1024];
9541 rng.fill_bytes(&mut buf);
9542 let mut unstructured = Unstructured::new(&buf);
9543 Self::arbitrary(&mut unstructured).unwrap_or_default()
9544 }
9545}
9546impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9547 fn default() -> Self {
9548 Self::DEFAULT.clone()
9549 }
9550}
9551impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9552 type Message = MavMessage;
9553 const ID: u32 = 396u32;
9554 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9555 const EXTRA_CRC: u8 = 50u8;
9556 const ENCODED_LEN: usize = 160usize;
9557 fn deser(
9558 _version: MavlinkVersion,
9559 __input: &[u8],
9560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9561 let avail_len = __input.len();
9562 let mut payload_buf = [0; Self::ENCODED_LEN];
9563 let mut buf = if avail_len < Self::ENCODED_LEN {
9564 payload_buf[0..avail_len].copy_from_slice(__input);
9565 Bytes::new(&payload_buf)
9566 } else {
9567 Bytes::new(__input)
9568 };
9569 let mut __struct = Self::default();
9570 let tmp = buf.get_u64_le();
9571 __struct.capabilities = MavProtocolCapability::from_bits(
9572 tmp & MavProtocolCapability::all().bits(),
9573 )
9574 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9575 flag_type: "MavProtocolCapability",
9576 value: tmp as u32,
9577 })?;
9578 __struct.time_boot_ms = buf.get_u32_le();
9579 __struct.time_manufacture_s = buf.get_u32_le();
9580 for v in &mut __struct.vendor_name {
9581 let val = buf.get_u8();
9582 *v = val;
9583 }
9584 for v in &mut __struct.model_name {
9585 let val = buf.get_u8();
9586 *v = val;
9587 }
9588 for v in &mut __struct.software_version {
9589 let val = buf.get_u8();
9590 *v = val;
9591 }
9592 for v in &mut __struct.hardware_version {
9593 let val = buf.get_u8();
9594 *v = val;
9595 }
9596 for v in &mut __struct.serial_number {
9597 let val = buf.get_u8();
9598 *v = val;
9599 }
9600 Ok(__struct)
9601 }
9602 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9603 let mut __tmp = BytesMut::new(bytes);
9604 #[allow(clippy::absurd_extreme_comparisons)]
9605 #[allow(unused_comparisons)]
9606 if __tmp.remaining() < Self::ENCODED_LEN {
9607 panic!(
9608 "buffer is too small (need {} bytes, but got {})",
9609 Self::ENCODED_LEN,
9610 __tmp.remaining(),
9611 )
9612 }
9613 __tmp.put_u64_le(self.capabilities.bits());
9614 __tmp.put_u32_le(self.time_boot_ms);
9615 __tmp.put_u32_le(self.time_manufacture_s);
9616 for val in &self.vendor_name {
9617 __tmp.put_u8(*val);
9618 }
9619 for val in &self.model_name {
9620 __tmp.put_u8(*val);
9621 }
9622 for val in &self.software_version {
9623 __tmp.put_u8(*val);
9624 }
9625 for val in &self.hardware_version {
9626 __tmp.put_u8(*val);
9627 }
9628 for val in &self.serial_number {
9629 __tmp.put_u8(*val);
9630 }
9631 if matches!(version, MavlinkVersion::V2) {
9632 let len = __tmp.len();
9633 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9634 } else {
9635 __tmp.len()
9636 }
9637 }
9638}
9639#[doc = "id: 397"]
9640#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9641#[derive(Debug, Clone, PartialEq)]
9642#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9643#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9644pub struct COMPONENT_METADATA_DATA {
9645 #[doc = "Timestamp (time since system boot)."]
9646 pub time_boot_ms: u32,
9647 #[doc = "CRC32 of the general metadata file."]
9648 pub file_crc: u32,
9649 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9650 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9651 pub uri: [u8; 100],
9652}
9653impl COMPONENT_METADATA_DATA {
9654 pub const ENCODED_LEN: usize = 108usize;
9655 pub const DEFAULT: Self = Self {
9656 time_boot_ms: 0_u32,
9657 file_crc: 0_u32,
9658 uri: [0_u8; 100usize],
9659 };
9660 #[cfg(feature = "arbitrary")]
9661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9662 use arbitrary::{Arbitrary, Unstructured};
9663 let mut buf = [0u8; 1024];
9664 rng.fill_bytes(&mut buf);
9665 let mut unstructured = Unstructured::new(&buf);
9666 Self::arbitrary(&mut unstructured).unwrap_or_default()
9667 }
9668}
9669impl Default for COMPONENT_METADATA_DATA {
9670 fn default() -> Self {
9671 Self::DEFAULT.clone()
9672 }
9673}
9674impl MessageData for COMPONENT_METADATA_DATA {
9675 type Message = MavMessage;
9676 const ID: u32 = 397u32;
9677 const NAME: &'static str = "COMPONENT_METADATA";
9678 const EXTRA_CRC: u8 = 182u8;
9679 const ENCODED_LEN: usize = 108usize;
9680 fn deser(
9681 _version: MavlinkVersion,
9682 __input: &[u8],
9683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9684 let avail_len = __input.len();
9685 let mut payload_buf = [0; Self::ENCODED_LEN];
9686 let mut buf = if avail_len < Self::ENCODED_LEN {
9687 payload_buf[0..avail_len].copy_from_slice(__input);
9688 Bytes::new(&payload_buf)
9689 } else {
9690 Bytes::new(__input)
9691 };
9692 let mut __struct = Self::default();
9693 __struct.time_boot_ms = buf.get_u32_le();
9694 __struct.file_crc = buf.get_u32_le();
9695 for v in &mut __struct.uri {
9696 let val = buf.get_u8();
9697 *v = val;
9698 }
9699 Ok(__struct)
9700 }
9701 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9702 let mut __tmp = BytesMut::new(bytes);
9703 #[allow(clippy::absurd_extreme_comparisons)]
9704 #[allow(unused_comparisons)]
9705 if __tmp.remaining() < Self::ENCODED_LEN {
9706 panic!(
9707 "buffer is too small (need {} bytes, but got {})",
9708 Self::ENCODED_LEN,
9709 __tmp.remaining(),
9710 )
9711 }
9712 __tmp.put_u32_le(self.time_boot_ms);
9713 __tmp.put_u32_le(self.file_crc);
9714 for val in &self.uri {
9715 __tmp.put_u8(*val);
9716 }
9717 if matches!(version, MavlinkVersion::V2) {
9718 let len = __tmp.len();
9719 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9720 } else {
9721 __tmp.len()
9722 }
9723 }
9724}
9725#[doc = "id: 512"]
9726#[doc = "Information about GCS in control of this MAV. This should be broadcast at low rate (nominally 1 Hz) and emitted when ownership or takeover status change. Control over MAV is requested using MAV_CMD_REQUEST_OPERATOR_CONTROL."]
9727#[derive(Debug, Clone, PartialEq)]
9728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9729#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9730pub struct CONTROL_STATUS_DATA {
9731 #[doc = "System ID of GCS MAVLink component in control (0: no GCS in control)."]
9732 pub sysid_in_control: u8,
9733 #[doc = "Control status. For example, whether takeover is allowed, and whether this message instance defines the default controlling GCS for the whole system."]
9734 pub flags: GcsControlStatusFlags,
9735}
9736impl CONTROL_STATUS_DATA {
9737 pub const ENCODED_LEN: usize = 2usize;
9738 pub const DEFAULT: Self = Self {
9739 sysid_in_control: 0_u8,
9740 flags: GcsControlStatusFlags::DEFAULT,
9741 };
9742 #[cfg(feature = "arbitrary")]
9743 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9744 use arbitrary::{Arbitrary, Unstructured};
9745 let mut buf = [0u8; 1024];
9746 rng.fill_bytes(&mut buf);
9747 let mut unstructured = Unstructured::new(&buf);
9748 Self::arbitrary(&mut unstructured).unwrap_or_default()
9749 }
9750}
9751impl Default for CONTROL_STATUS_DATA {
9752 fn default() -> Self {
9753 Self::DEFAULT.clone()
9754 }
9755}
9756impl MessageData for CONTROL_STATUS_DATA {
9757 type Message = MavMessage;
9758 const ID: u32 = 512u32;
9759 const NAME: &'static str = "CONTROL_STATUS";
9760 const EXTRA_CRC: u8 = 184u8;
9761 const ENCODED_LEN: usize = 2usize;
9762 fn deser(
9763 _version: MavlinkVersion,
9764 __input: &[u8],
9765 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9766 let avail_len = __input.len();
9767 let mut payload_buf = [0; Self::ENCODED_LEN];
9768 let mut buf = if avail_len < Self::ENCODED_LEN {
9769 payload_buf[0..avail_len].copy_from_slice(__input);
9770 Bytes::new(&payload_buf)
9771 } else {
9772 Bytes::new(__input)
9773 };
9774 let mut __struct = Self::default();
9775 __struct.sysid_in_control = buf.get_u8();
9776 let tmp = buf.get_u8();
9777 __struct.flags = GcsControlStatusFlags::from_bits(
9778 tmp & GcsControlStatusFlags::all().bits(),
9779 )
9780 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9781 flag_type: "GcsControlStatusFlags",
9782 value: tmp as u32,
9783 })?;
9784 Ok(__struct)
9785 }
9786 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9787 let mut __tmp = BytesMut::new(bytes);
9788 #[allow(clippy::absurd_extreme_comparisons)]
9789 #[allow(unused_comparisons)]
9790 if __tmp.remaining() < Self::ENCODED_LEN {
9791 panic!(
9792 "buffer is too small (need {} bytes, but got {})",
9793 Self::ENCODED_LEN,
9794 __tmp.remaining(),
9795 )
9796 }
9797 __tmp.put_u8(self.sysid_in_control);
9798 __tmp.put_u8(self.flags.bits());
9799 if matches!(version, MavlinkVersion::V2) {
9800 let len = __tmp.len();
9801 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9802 } else {
9803 __tmp.len()
9804 }
9805 }
9806}
9807#[doc = "id: 146"]
9808#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9809#[derive(Debug, Clone, PartialEq)]
9810#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9811#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9812pub struct CONTROL_SYSTEM_STATE_DATA {
9813 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9814 pub time_usec: u64,
9815 #[doc = "X acceleration in body frame"]
9816 pub x_acc: f32,
9817 #[doc = "Y acceleration in body frame"]
9818 pub y_acc: f32,
9819 #[doc = "Z acceleration in body frame"]
9820 pub z_acc: f32,
9821 #[doc = "X velocity in body frame"]
9822 pub x_vel: f32,
9823 #[doc = "Y velocity in body frame"]
9824 pub y_vel: f32,
9825 #[doc = "Z velocity in body frame"]
9826 pub z_vel: f32,
9827 #[doc = "X position in local frame"]
9828 pub x_pos: f32,
9829 #[doc = "Y position in local frame"]
9830 pub y_pos: f32,
9831 #[doc = "Z position in local frame"]
9832 pub z_pos: f32,
9833 #[doc = "Airspeed, set to -1 if unknown"]
9834 pub airspeed: f32,
9835 #[doc = "Variance of body velocity estimate"]
9836 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9837 pub vel_variance: [f32; 3],
9838 #[doc = "Variance in local position"]
9839 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9840 pub pos_variance: [f32; 3],
9841 #[doc = "The attitude, represented as Quaternion"]
9842 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9843 pub q: [f32; 4],
9844 #[doc = "Angular rate in roll axis"]
9845 pub roll_rate: f32,
9846 #[doc = "Angular rate in pitch axis"]
9847 pub pitch_rate: f32,
9848 #[doc = "Angular rate in yaw axis"]
9849 pub yaw_rate: f32,
9850}
9851impl CONTROL_SYSTEM_STATE_DATA {
9852 pub const ENCODED_LEN: usize = 100usize;
9853 pub const DEFAULT: Self = Self {
9854 time_usec: 0_u64,
9855 x_acc: 0.0_f32,
9856 y_acc: 0.0_f32,
9857 z_acc: 0.0_f32,
9858 x_vel: 0.0_f32,
9859 y_vel: 0.0_f32,
9860 z_vel: 0.0_f32,
9861 x_pos: 0.0_f32,
9862 y_pos: 0.0_f32,
9863 z_pos: 0.0_f32,
9864 airspeed: 0.0_f32,
9865 vel_variance: [0.0_f32; 3usize],
9866 pos_variance: [0.0_f32; 3usize],
9867 q: [0.0_f32; 4usize],
9868 roll_rate: 0.0_f32,
9869 pitch_rate: 0.0_f32,
9870 yaw_rate: 0.0_f32,
9871 };
9872 #[cfg(feature = "arbitrary")]
9873 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9874 use arbitrary::{Arbitrary, Unstructured};
9875 let mut buf = [0u8; 1024];
9876 rng.fill_bytes(&mut buf);
9877 let mut unstructured = Unstructured::new(&buf);
9878 Self::arbitrary(&mut unstructured).unwrap_or_default()
9879 }
9880}
9881impl Default for CONTROL_SYSTEM_STATE_DATA {
9882 fn default() -> Self {
9883 Self::DEFAULT.clone()
9884 }
9885}
9886impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9887 type Message = MavMessage;
9888 const ID: u32 = 146u32;
9889 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9890 const EXTRA_CRC: u8 = 103u8;
9891 const ENCODED_LEN: usize = 100usize;
9892 fn deser(
9893 _version: MavlinkVersion,
9894 __input: &[u8],
9895 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9896 let avail_len = __input.len();
9897 let mut payload_buf = [0; Self::ENCODED_LEN];
9898 let mut buf = if avail_len < Self::ENCODED_LEN {
9899 payload_buf[0..avail_len].copy_from_slice(__input);
9900 Bytes::new(&payload_buf)
9901 } else {
9902 Bytes::new(__input)
9903 };
9904 let mut __struct = Self::default();
9905 __struct.time_usec = buf.get_u64_le();
9906 __struct.x_acc = buf.get_f32_le();
9907 __struct.y_acc = buf.get_f32_le();
9908 __struct.z_acc = buf.get_f32_le();
9909 __struct.x_vel = buf.get_f32_le();
9910 __struct.y_vel = buf.get_f32_le();
9911 __struct.z_vel = buf.get_f32_le();
9912 __struct.x_pos = buf.get_f32_le();
9913 __struct.y_pos = buf.get_f32_le();
9914 __struct.z_pos = buf.get_f32_le();
9915 __struct.airspeed = buf.get_f32_le();
9916 for v in &mut __struct.vel_variance {
9917 let val = buf.get_f32_le();
9918 *v = val;
9919 }
9920 for v in &mut __struct.pos_variance {
9921 let val = buf.get_f32_le();
9922 *v = val;
9923 }
9924 for v in &mut __struct.q {
9925 let val = buf.get_f32_le();
9926 *v = val;
9927 }
9928 __struct.roll_rate = buf.get_f32_le();
9929 __struct.pitch_rate = buf.get_f32_le();
9930 __struct.yaw_rate = buf.get_f32_le();
9931 Ok(__struct)
9932 }
9933 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9934 let mut __tmp = BytesMut::new(bytes);
9935 #[allow(clippy::absurd_extreme_comparisons)]
9936 #[allow(unused_comparisons)]
9937 if __tmp.remaining() < Self::ENCODED_LEN {
9938 panic!(
9939 "buffer is too small (need {} bytes, but got {})",
9940 Self::ENCODED_LEN,
9941 __tmp.remaining(),
9942 )
9943 }
9944 __tmp.put_u64_le(self.time_usec);
9945 __tmp.put_f32_le(self.x_acc);
9946 __tmp.put_f32_le(self.y_acc);
9947 __tmp.put_f32_le(self.z_acc);
9948 __tmp.put_f32_le(self.x_vel);
9949 __tmp.put_f32_le(self.y_vel);
9950 __tmp.put_f32_le(self.z_vel);
9951 __tmp.put_f32_le(self.x_pos);
9952 __tmp.put_f32_le(self.y_pos);
9953 __tmp.put_f32_le(self.z_pos);
9954 __tmp.put_f32_le(self.airspeed);
9955 for val in &self.vel_variance {
9956 __tmp.put_f32_le(*val);
9957 }
9958 for val in &self.pos_variance {
9959 __tmp.put_f32_le(*val);
9960 }
9961 for val in &self.q {
9962 __tmp.put_f32_le(*val);
9963 }
9964 __tmp.put_f32_le(self.roll_rate);
9965 __tmp.put_f32_le(self.pitch_rate);
9966 __tmp.put_f32_le(self.yaw_rate);
9967 if matches!(version, MavlinkVersion::V2) {
9968 let len = __tmp.len();
9969 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9970 } else {
9971 __tmp.len()
9972 }
9973 }
9974}
9975#[doc = "id: 411"]
9976#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
9977#[derive(Debug, Clone, PartialEq)]
9978#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9979#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9980pub struct CURRENT_EVENT_SEQUENCE_DATA {
9981 #[doc = "Sequence number."]
9982 pub sequence: u16,
9983 #[doc = "Flag bitset."]
9984 pub flags: MavEventCurrentSequenceFlags,
9985}
9986impl CURRENT_EVENT_SEQUENCE_DATA {
9987 pub const ENCODED_LEN: usize = 3usize;
9988 pub const DEFAULT: Self = Self {
9989 sequence: 0_u16,
9990 flags: MavEventCurrentSequenceFlags::DEFAULT,
9991 };
9992 #[cfg(feature = "arbitrary")]
9993 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9994 use arbitrary::{Arbitrary, Unstructured};
9995 let mut buf = [0u8; 1024];
9996 rng.fill_bytes(&mut buf);
9997 let mut unstructured = Unstructured::new(&buf);
9998 Self::arbitrary(&mut unstructured).unwrap_or_default()
9999 }
10000}
10001impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10002 fn default() -> Self {
10003 Self::DEFAULT.clone()
10004 }
10005}
10006impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10007 type Message = MavMessage;
10008 const ID: u32 = 411u32;
10009 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10010 const EXTRA_CRC: u8 = 106u8;
10011 const ENCODED_LEN: usize = 3usize;
10012 fn deser(
10013 _version: MavlinkVersion,
10014 __input: &[u8],
10015 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10016 let avail_len = __input.len();
10017 let mut payload_buf = [0; Self::ENCODED_LEN];
10018 let mut buf = if avail_len < Self::ENCODED_LEN {
10019 payload_buf[0..avail_len].copy_from_slice(__input);
10020 Bytes::new(&payload_buf)
10021 } else {
10022 Bytes::new(__input)
10023 };
10024 let mut __struct = Self::default();
10025 __struct.sequence = buf.get_u16_le();
10026 let tmp = buf.get_u8();
10027 __struct.flags =
10028 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10029 enum_type: "MavEventCurrentSequenceFlags",
10030 value: tmp as u32,
10031 })?;
10032 Ok(__struct)
10033 }
10034 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10035 let mut __tmp = BytesMut::new(bytes);
10036 #[allow(clippy::absurd_extreme_comparisons)]
10037 #[allow(unused_comparisons)]
10038 if __tmp.remaining() < Self::ENCODED_LEN {
10039 panic!(
10040 "buffer is too small (need {} bytes, but got {})",
10041 Self::ENCODED_LEN,
10042 __tmp.remaining(),
10043 )
10044 }
10045 __tmp.put_u16_le(self.sequence);
10046 __tmp.put_u8(self.flags as u8);
10047 if matches!(version, MavlinkVersion::V2) {
10048 let len = __tmp.len();
10049 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10050 } else {
10051 __tmp.len()
10052 }
10053 }
10054}
10055#[doc = "id: 436"]
10056#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10057#[derive(Debug, Clone, PartialEq)]
10058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10060pub struct CURRENT_MODE_DATA {
10061 #[doc = "A bitfield for use for autopilot-specific flags"]
10062 pub custom_mode: u32,
10063 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10064 pub intended_custom_mode: u32,
10065 #[doc = "Standard mode."]
10066 pub standard_mode: MavStandardMode,
10067}
10068impl CURRENT_MODE_DATA {
10069 pub const ENCODED_LEN: usize = 9usize;
10070 pub const DEFAULT: Self = Self {
10071 custom_mode: 0_u32,
10072 intended_custom_mode: 0_u32,
10073 standard_mode: MavStandardMode::DEFAULT,
10074 };
10075 #[cfg(feature = "arbitrary")]
10076 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10077 use arbitrary::{Arbitrary, Unstructured};
10078 let mut buf = [0u8; 1024];
10079 rng.fill_bytes(&mut buf);
10080 let mut unstructured = Unstructured::new(&buf);
10081 Self::arbitrary(&mut unstructured).unwrap_or_default()
10082 }
10083}
10084impl Default for CURRENT_MODE_DATA {
10085 fn default() -> Self {
10086 Self::DEFAULT.clone()
10087 }
10088}
10089impl MessageData for CURRENT_MODE_DATA {
10090 type Message = MavMessage;
10091 const ID: u32 = 436u32;
10092 const NAME: &'static str = "CURRENT_MODE";
10093 const EXTRA_CRC: u8 = 193u8;
10094 const ENCODED_LEN: usize = 9usize;
10095 fn deser(
10096 _version: MavlinkVersion,
10097 __input: &[u8],
10098 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10099 let avail_len = __input.len();
10100 let mut payload_buf = [0; Self::ENCODED_LEN];
10101 let mut buf = if avail_len < Self::ENCODED_LEN {
10102 payload_buf[0..avail_len].copy_from_slice(__input);
10103 Bytes::new(&payload_buf)
10104 } else {
10105 Bytes::new(__input)
10106 };
10107 let mut __struct = Self::default();
10108 __struct.custom_mode = buf.get_u32_le();
10109 __struct.intended_custom_mode = buf.get_u32_le();
10110 let tmp = buf.get_u8();
10111 __struct.standard_mode =
10112 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10113 enum_type: "MavStandardMode",
10114 value: tmp as u32,
10115 })?;
10116 Ok(__struct)
10117 }
10118 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10119 let mut __tmp = BytesMut::new(bytes);
10120 #[allow(clippy::absurd_extreme_comparisons)]
10121 #[allow(unused_comparisons)]
10122 if __tmp.remaining() < Self::ENCODED_LEN {
10123 panic!(
10124 "buffer is too small (need {} bytes, but got {})",
10125 Self::ENCODED_LEN,
10126 __tmp.remaining(),
10127 )
10128 }
10129 __tmp.put_u32_le(self.custom_mode);
10130 __tmp.put_u32_le(self.intended_custom_mode);
10131 __tmp.put_u8(self.standard_mode as u8);
10132 if matches!(version, MavlinkVersion::V2) {
10133 let len = __tmp.len();
10134 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10135 } else {
10136 __tmp.len()
10137 }
10138 }
10139}
10140#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10141#[doc = "id: 67"]
10142#[doc = "Data stream status information."]
10143#[derive(Debug, Clone, PartialEq)]
10144#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10145#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10146pub struct DATA_STREAM_DATA {
10147 #[doc = "The message rate"]
10148 pub message_rate: u16,
10149 #[doc = "The ID of the requested data stream"]
10150 pub stream_id: u8,
10151 #[doc = "1 stream is enabled, 0 stream is stopped."]
10152 pub on_off: u8,
10153}
10154impl DATA_STREAM_DATA {
10155 pub const ENCODED_LEN: usize = 4usize;
10156 pub const DEFAULT: Self = Self {
10157 message_rate: 0_u16,
10158 stream_id: 0_u8,
10159 on_off: 0_u8,
10160 };
10161 #[cfg(feature = "arbitrary")]
10162 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10163 use arbitrary::{Arbitrary, Unstructured};
10164 let mut buf = [0u8; 1024];
10165 rng.fill_bytes(&mut buf);
10166 let mut unstructured = Unstructured::new(&buf);
10167 Self::arbitrary(&mut unstructured).unwrap_or_default()
10168 }
10169}
10170impl Default for DATA_STREAM_DATA {
10171 fn default() -> Self {
10172 Self::DEFAULT.clone()
10173 }
10174}
10175impl MessageData for DATA_STREAM_DATA {
10176 type Message = MavMessage;
10177 const ID: u32 = 67u32;
10178 const NAME: &'static str = "DATA_STREAM";
10179 const EXTRA_CRC: u8 = 21u8;
10180 const ENCODED_LEN: usize = 4usize;
10181 fn deser(
10182 _version: MavlinkVersion,
10183 __input: &[u8],
10184 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10185 let avail_len = __input.len();
10186 let mut payload_buf = [0; Self::ENCODED_LEN];
10187 let mut buf = if avail_len < Self::ENCODED_LEN {
10188 payload_buf[0..avail_len].copy_from_slice(__input);
10189 Bytes::new(&payload_buf)
10190 } else {
10191 Bytes::new(__input)
10192 };
10193 let mut __struct = Self::default();
10194 __struct.message_rate = buf.get_u16_le();
10195 __struct.stream_id = buf.get_u8();
10196 __struct.on_off = buf.get_u8();
10197 Ok(__struct)
10198 }
10199 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10200 let mut __tmp = BytesMut::new(bytes);
10201 #[allow(clippy::absurd_extreme_comparisons)]
10202 #[allow(unused_comparisons)]
10203 if __tmp.remaining() < Self::ENCODED_LEN {
10204 panic!(
10205 "buffer is too small (need {} bytes, but got {})",
10206 Self::ENCODED_LEN,
10207 __tmp.remaining(),
10208 )
10209 }
10210 __tmp.put_u16_le(self.message_rate);
10211 __tmp.put_u8(self.stream_id);
10212 __tmp.put_u8(self.on_off);
10213 if matches!(version, MavlinkVersion::V2) {
10214 let len = __tmp.len();
10215 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10216 } else {
10217 __tmp.len()
10218 }
10219 }
10220}
10221#[doc = "id: 130"]
10222#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10223#[derive(Debug, Clone, PartialEq)]
10224#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10225#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10226pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10227 #[doc = "total data size (set on ACK only)."]
10228 pub size: u32,
10229 #[doc = "Width of a matrix or image."]
10230 pub width: u16,
10231 #[doc = "Height of a matrix or image."]
10232 pub height: u16,
10233 #[doc = "Number of packets being sent (set on ACK only)."]
10234 pub packets: u16,
10235 #[doc = "Type of requested/acknowledged data."]
10236 pub mavtype: MavlinkDataStreamType,
10237 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10238 pub payload: u8,
10239 #[doc = "JPEG quality. Values: [1-100]."]
10240 pub jpg_quality: u8,
10241}
10242impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10243 pub const ENCODED_LEN: usize = 13usize;
10244 pub const DEFAULT: Self = Self {
10245 size: 0_u32,
10246 width: 0_u16,
10247 height: 0_u16,
10248 packets: 0_u16,
10249 mavtype: MavlinkDataStreamType::DEFAULT,
10250 payload: 0_u8,
10251 jpg_quality: 0_u8,
10252 };
10253 #[cfg(feature = "arbitrary")]
10254 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10255 use arbitrary::{Arbitrary, Unstructured};
10256 let mut buf = [0u8; 1024];
10257 rng.fill_bytes(&mut buf);
10258 let mut unstructured = Unstructured::new(&buf);
10259 Self::arbitrary(&mut unstructured).unwrap_or_default()
10260 }
10261}
10262impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10263 fn default() -> Self {
10264 Self::DEFAULT.clone()
10265 }
10266}
10267impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10268 type Message = MavMessage;
10269 const ID: u32 = 130u32;
10270 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10271 const EXTRA_CRC: u8 = 29u8;
10272 const ENCODED_LEN: usize = 13usize;
10273 fn deser(
10274 _version: MavlinkVersion,
10275 __input: &[u8],
10276 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10277 let avail_len = __input.len();
10278 let mut payload_buf = [0; Self::ENCODED_LEN];
10279 let mut buf = if avail_len < Self::ENCODED_LEN {
10280 payload_buf[0..avail_len].copy_from_slice(__input);
10281 Bytes::new(&payload_buf)
10282 } else {
10283 Bytes::new(__input)
10284 };
10285 let mut __struct = Self::default();
10286 __struct.size = buf.get_u32_le();
10287 __struct.width = buf.get_u16_le();
10288 __struct.height = buf.get_u16_le();
10289 __struct.packets = buf.get_u16_le();
10290 let tmp = buf.get_u8();
10291 __struct.mavtype =
10292 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10293 enum_type: "MavlinkDataStreamType",
10294 value: tmp as u32,
10295 })?;
10296 __struct.payload = buf.get_u8();
10297 __struct.jpg_quality = buf.get_u8();
10298 Ok(__struct)
10299 }
10300 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10301 let mut __tmp = BytesMut::new(bytes);
10302 #[allow(clippy::absurd_extreme_comparisons)]
10303 #[allow(unused_comparisons)]
10304 if __tmp.remaining() < Self::ENCODED_LEN {
10305 panic!(
10306 "buffer is too small (need {} bytes, but got {})",
10307 Self::ENCODED_LEN,
10308 __tmp.remaining(),
10309 )
10310 }
10311 __tmp.put_u32_le(self.size);
10312 __tmp.put_u16_le(self.width);
10313 __tmp.put_u16_le(self.height);
10314 __tmp.put_u16_le(self.packets);
10315 __tmp.put_u8(self.mavtype as u8);
10316 __tmp.put_u8(self.payload);
10317 __tmp.put_u8(self.jpg_quality);
10318 if matches!(version, MavlinkVersion::V2) {
10319 let len = __tmp.len();
10320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10321 } else {
10322 __tmp.len()
10323 }
10324 }
10325}
10326#[doc = "id: 254"]
10327#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10328#[derive(Debug, Clone, PartialEq)]
10329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10331pub struct DEBUG_DATA {
10332 #[doc = "Timestamp (time since system boot)."]
10333 pub time_boot_ms: u32,
10334 #[doc = "DEBUG value"]
10335 pub value: f32,
10336 #[doc = "index of debug variable"]
10337 pub ind: u8,
10338}
10339impl DEBUG_DATA {
10340 pub const ENCODED_LEN: usize = 9usize;
10341 pub const DEFAULT: Self = Self {
10342 time_boot_ms: 0_u32,
10343 value: 0.0_f32,
10344 ind: 0_u8,
10345 };
10346 #[cfg(feature = "arbitrary")]
10347 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10348 use arbitrary::{Arbitrary, Unstructured};
10349 let mut buf = [0u8; 1024];
10350 rng.fill_bytes(&mut buf);
10351 let mut unstructured = Unstructured::new(&buf);
10352 Self::arbitrary(&mut unstructured).unwrap_or_default()
10353 }
10354}
10355impl Default for DEBUG_DATA {
10356 fn default() -> Self {
10357 Self::DEFAULT.clone()
10358 }
10359}
10360impl MessageData for DEBUG_DATA {
10361 type Message = MavMessage;
10362 const ID: u32 = 254u32;
10363 const NAME: &'static str = "DEBUG";
10364 const EXTRA_CRC: u8 = 46u8;
10365 const ENCODED_LEN: usize = 9usize;
10366 fn deser(
10367 _version: MavlinkVersion,
10368 __input: &[u8],
10369 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10370 let avail_len = __input.len();
10371 let mut payload_buf = [0; Self::ENCODED_LEN];
10372 let mut buf = if avail_len < Self::ENCODED_LEN {
10373 payload_buf[0..avail_len].copy_from_slice(__input);
10374 Bytes::new(&payload_buf)
10375 } else {
10376 Bytes::new(__input)
10377 };
10378 let mut __struct = Self::default();
10379 __struct.time_boot_ms = buf.get_u32_le();
10380 __struct.value = buf.get_f32_le();
10381 __struct.ind = buf.get_u8();
10382 Ok(__struct)
10383 }
10384 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10385 let mut __tmp = BytesMut::new(bytes);
10386 #[allow(clippy::absurd_extreme_comparisons)]
10387 #[allow(unused_comparisons)]
10388 if __tmp.remaining() < Self::ENCODED_LEN {
10389 panic!(
10390 "buffer is too small (need {} bytes, but got {})",
10391 Self::ENCODED_LEN,
10392 __tmp.remaining(),
10393 )
10394 }
10395 __tmp.put_u32_le(self.time_boot_ms);
10396 __tmp.put_f32_le(self.value);
10397 __tmp.put_u8(self.ind);
10398 if matches!(version, MavlinkVersion::V2) {
10399 let len = __tmp.len();
10400 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10401 } else {
10402 __tmp.len()
10403 }
10404 }
10405}
10406#[doc = "id: 350"]
10407#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10408#[derive(Debug, Clone, PartialEq)]
10409#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10410#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10411pub struct DEBUG_FLOAT_ARRAY_DATA {
10412 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10413 pub time_usec: u64,
10414 #[doc = "Unique ID used to discriminate between arrays"]
10415 pub array_id: u16,
10416 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10417 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10418 pub name: [u8; 10],
10419 #[doc = "data"]
10420 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10421 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10422 pub data: [f32; 58],
10423}
10424impl DEBUG_FLOAT_ARRAY_DATA {
10425 pub const ENCODED_LEN: usize = 252usize;
10426 pub const DEFAULT: Self = Self {
10427 time_usec: 0_u64,
10428 array_id: 0_u16,
10429 name: [0_u8; 10usize],
10430 data: [0.0_f32; 58usize],
10431 };
10432 #[cfg(feature = "arbitrary")]
10433 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10434 use arbitrary::{Arbitrary, Unstructured};
10435 let mut buf = [0u8; 1024];
10436 rng.fill_bytes(&mut buf);
10437 let mut unstructured = Unstructured::new(&buf);
10438 Self::arbitrary(&mut unstructured).unwrap_or_default()
10439 }
10440}
10441impl Default for DEBUG_FLOAT_ARRAY_DATA {
10442 fn default() -> Self {
10443 Self::DEFAULT.clone()
10444 }
10445}
10446impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10447 type Message = MavMessage;
10448 const ID: u32 = 350u32;
10449 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10450 const EXTRA_CRC: u8 = 232u8;
10451 const ENCODED_LEN: usize = 252usize;
10452 fn deser(
10453 _version: MavlinkVersion,
10454 __input: &[u8],
10455 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10456 let avail_len = __input.len();
10457 let mut payload_buf = [0; Self::ENCODED_LEN];
10458 let mut buf = if avail_len < Self::ENCODED_LEN {
10459 payload_buf[0..avail_len].copy_from_slice(__input);
10460 Bytes::new(&payload_buf)
10461 } else {
10462 Bytes::new(__input)
10463 };
10464 let mut __struct = Self::default();
10465 __struct.time_usec = buf.get_u64_le();
10466 __struct.array_id = buf.get_u16_le();
10467 for v in &mut __struct.name {
10468 let val = buf.get_u8();
10469 *v = val;
10470 }
10471 for v in &mut __struct.data {
10472 let val = buf.get_f32_le();
10473 *v = val;
10474 }
10475 Ok(__struct)
10476 }
10477 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10478 let mut __tmp = BytesMut::new(bytes);
10479 #[allow(clippy::absurd_extreme_comparisons)]
10480 #[allow(unused_comparisons)]
10481 if __tmp.remaining() < Self::ENCODED_LEN {
10482 panic!(
10483 "buffer is too small (need {} bytes, but got {})",
10484 Self::ENCODED_LEN,
10485 __tmp.remaining(),
10486 )
10487 }
10488 __tmp.put_u64_le(self.time_usec);
10489 __tmp.put_u16_le(self.array_id);
10490 for val in &self.name {
10491 __tmp.put_u8(*val);
10492 }
10493 for val in &self.data {
10494 __tmp.put_f32_le(*val);
10495 }
10496 if matches!(version, MavlinkVersion::V2) {
10497 let len = __tmp.len();
10498 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10499 } else {
10500 __tmp.len()
10501 }
10502 }
10503}
10504#[doc = "id: 250"]
10505#[doc = "To debug something using a named 3D vector."]
10506#[derive(Debug, Clone, PartialEq)]
10507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10509pub struct DEBUG_VECT_DATA {
10510 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10511 pub time_usec: u64,
10512 #[doc = "x"]
10513 pub x: f32,
10514 #[doc = "y"]
10515 pub y: f32,
10516 #[doc = "z"]
10517 pub z: f32,
10518 #[doc = "Name"]
10519 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10520 pub name: [u8; 10],
10521}
10522impl DEBUG_VECT_DATA {
10523 pub const ENCODED_LEN: usize = 30usize;
10524 pub const DEFAULT: Self = Self {
10525 time_usec: 0_u64,
10526 x: 0.0_f32,
10527 y: 0.0_f32,
10528 z: 0.0_f32,
10529 name: [0_u8; 10usize],
10530 };
10531 #[cfg(feature = "arbitrary")]
10532 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10533 use arbitrary::{Arbitrary, Unstructured};
10534 let mut buf = [0u8; 1024];
10535 rng.fill_bytes(&mut buf);
10536 let mut unstructured = Unstructured::new(&buf);
10537 Self::arbitrary(&mut unstructured).unwrap_or_default()
10538 }
10539}
10540impl Default for DEBUG_VECT_DATA {
10541 fn default() -> Self {
10542 Self::DEFAULT.clone()
10543 }
10544}
10545impl MessageData for DEBUG_VECT_DATA {
10546 type Message = MavMessage;
10547 const ID: u32 = 250u32;
10548 const NAME: &'static str = "DEBUG_VECT";
10549 const EXTRA_CRC: u8 = 49u8;
10550 const ENCODED_LEN: usize = 30usize;
10551 fn deser(
10552 _version: MavlinkVersion,
10553 __input: &[u8],
10554 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10555 let avail_len = __input.len();
10556 let mut payload_buf = [0; Self::ENCODED_LEN];
10557 let mut buf = if avail_len < Self::ENCODED_LEN {
10558 payload_buf[0..avail_len].copy_from_slice(__input);
10559 Bytes::new(&payload_buf)
10560 } else {
10561 Bytes::new(__input)
10562 };
10563 let mut __struct = Self::default();
10564 __struct.time_usec = buf.get_u64_le();
10565 __struct.x = buf.get_f32_le();
10566 __struct.y = buf.get_f32_le();
10567 __struct.z = buf.get_f32_le();
10568 for v in &mut __struct.name {
10569 let val = buf.get_u8();
10570 *v = val;
10571 }
10572 Ok(__struct)
10573 }
10574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10575 let mut __tmp = BytesMut::new(bytes);
10576 #[allow(clippy::absurd_extreme_comparisons)]
10577 #[allow(unused_comparisons)]
10578 if __tmp.remaining() < Self::ENCODED_LEN {
10579 panic!(
10580 "buffer is too small (need {} bytes, but got {})",
10581 Self::ENCODED_LEN,
10582 __tmp.remaining(),
10583 )
10584 }
10585 __tmp.put_u64_le(self.time_usec);
10586 __tmp.put_f32_le(self.x);
10587 __tmp.put_f32_le(self.y);
10588 __tmp.put_f32_le(self.z);
10589 for val in &self.name {
10590 __tmp.put_u8(*val);
10591 }
10592 if matches!(version, MavlinkVersion::V2) {
10593 let len = __tmp.len();
10594 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10595 } else {
10596 __tmp.len()
10597 }
10598 }
10599}
10600#[doc = "id: 132"]
10601#[doc = "Distance sensor information for an onboard rangefinder."]
10602#[derive(Debug, Clone, PartialEq)]
10603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10604#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10605pub struct DISTANCE_SENSOR_DATA {
10606 #[doc = "Timestamp (time since system boot)."]
10607 pub time_boot_ms: u32,
10608 #[doc = "Minimum distance the sensor can measure"]
10609 pub min_distance: u16,
10610 #[doc = "Maximum distance the sensor can measure"]
10611 pub max_distance: u16,
10612 #[doc = "Current distance reading"]
10613 pub current_distance: u16,
10614 #[doc = "Type of distance sensor."]
10615 pub mavtype: MavDistanceSensor,
10616 #[doc = "Onboard ID of the sensor"]
10617 pub id: u8,
10618 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10619 pub orientation: MavSensorOrientation,
10620 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10621 pub covariance: u8,
10622 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10623 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10624 pub horizontal_fov: f32,
10625 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10626 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10627 pub vertical_fov: f32,
10628 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10629 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10630 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10631 pub quaternion: [f32; 4],
10632 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10633 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10634 pub signal_quality: u8,
10635}
10636impl DISTANCE_SENSOR_DATA {
10637 pub const ENCODED_LEN: usize = 39usize;
10638 pub const DEFAULT: Self = Self {
10639 time_boot_ms: 0_u32,
10640 min_distance: 0_u16,
10641 max_distance: 0_u16,
10642 current_distance: 0_u16,
10643 mavtype: MavDistanceSensor::DEFAULT,
10644 id: 0_u8,
10645 orientation: MavSensorOrientation::DEFAULT,
10646 covariance: 0_u8,
10647 horizontal_fov: 0.0_f32,
10648 vertical_fov: 0.0_f32,
10649 quaternion: [0.0_f32; 4usize],
10650 signal_quality: 0_u8,
10651 };
10652 #[cfg(feature = "arbitrary")]
10653 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10654 use arbitrary::{Arbitrary, Unstructured};
10655 let mut buf = [0u8; 1024];
10656 rng.fill_bytes(&mut buf);
10657 let mut unstructured = Unstructured::new(&buf);
10658 Self::arbitrary(&mut unstructured).unwrap_or_default()
10659 }
10660}
10661impl Default for DISTANCE_SENSOR_DATA {
10662 fn default() -> Self {
10663 Self::DEFAULT.clone()
10664 }
10665}
10666impl MessageData for DISTANCE_SENSOR_DATA {
10667 type Message = MavMessage;
10668 const ID: u32 = 132u32;
10669 const NAME: &'static str = "DISTANCE_SENSOR";
10670 const EXTRA_CRC: u8 = 85u8;
10671 const ENCODED_LEN: usize = 39usize;
10672 fn deser(
10673 _version: MavlinkVersion,
10674 __input: &[u8],
10675 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10676 let avail_len = __input.len();
10677 let mut payload_buf = [0; Self::ENCODED_LEN];
10678 let mut buf = if avail_len < Self::ENCODED_LEN {
10679 payload_buf[0..avail_len].copy_from_slice(__input);
10680 Bytes::new(&payload_buf)
10681 } else {
10682 Bytes::new(__input)
10683 };
10684 let mut __struct = Self::default();
10685 __struct.time_boot_ms = buf.get_u32_le();
10686 __struct.min_distance = buf.get_u16_le();
10687 __struct.max_distance = buf.get_u16_le();
10688 __struct.current_distance = buf.get_u16_le();
10689 let tmp = buf.get_u8();
10690 __struct.mavtype =
10691 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10692 enum_type: "MavDistanceSensor",
10693 value: tmp as u32,
10694 })?;
10695 __struct.id = buf.get_u8();
10696 let tmp = buf.get_u8();
10697 __struct.orientation =
10698 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10699 enum_type: "MavSensorOrientation",
10700 value: tmp as u32,
10701 })?;
10702 __struct.covariance = buf.get_u8();
10703 __struct.horizontal_fov = buf.get_f32_le();
10704 __struct.vertical_fov = buf.get_f32_le();
10705 for v in &mut __struct.quaternion {
10706 let val = buf.get_f32_le();
10707 *v = val;
10708 }
10709 __struct.signal_quality = buf.get_u8();
10710 Ok(__struct)
10711 }
10712 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10713 let mut __tmp = BytesMut::new(bytes);
10714 #[allow(clippy::absurd_extreme_comparisons)]
10715 #[allow(unused_comparisons)]
10716 if __tmp.remaining() < Self::ENCODED_LEN {
10717 panic!(
10718 "buffer is too small (need {} bytes, but got {})",
10719 Self::ENCODED_LEN,
10720 __tmp.remaining(),
10721 )
10722 }
10723 __tmp.put_u32_le(self.time_boot_ms);
10724 __tmp.put_u16_le(self.min_distance);
10725 __tmp.put_u16_le(self.max_distance);
10726 __tmp.put_u16_le(self.current_distance);
10727 __tmp.put_u8(self.mavtype as u8);
10728 __tmp.put_u8(self.id);
10729 __tmp.put_u8(self.orientation as u8);
10730 __tmp.put_u8(self.covariance);
10731 __tmp.put_f32_le(self.horizontal_fov);
10732 __tmp.put_f32_le(self.vertical_fov);
10733 for val in &self.quaternion {
10734 __tmp.put_f32_le(*val);
10735 }
10736 __tmp.put_u8(self.signal_quality);
10737 if matches!(version, MavlinkVersion::V2) {
10738 let len = __tmp.len();
10739 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10740 } else {
10741 __tmp.len()
10742 }
10743 }
10744}
10745#[doc = "id: 225"]
10746#[doc = "EFI status output."]
10747#[derive(Debug, Clone, PartialEq)]
10748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10750pub struct EFI_STATUS_DATA {
10751 #[doc = "ECU index"]
10752 pub ecu_index: f32,
10753 #[doc = "RPM"]
10754 pub rpm: f32,
10755 #[doc = "Fuel consumed"]
10756 pub fuel_consumed: f32,
10757 #[doc = "Fuel flow rate"]
10758 pub fuel_flow: f32,
10759 #[doc = "Engine load"]
10760 pub engine_load: f32,
10761 #[doc = "Throttle position"]
10762 pub throttle_position: f32,
10763 #[doc = "Spark dwell time"]
10764 pub spark_dwell_time: f32,
10765 #[doc = "Barometric pressure"]
10766 pub barometric_pressure: f32,
10767 #[doc = "Intake manifold pressure("]
10768 pub intake_manifold_pressure: f32,
10769 #[doc = "Intake manifold temperature"]
10770 pub intake_manifold_temperature: f32,
10771 #[doc = "Cylinder head temperature"]
10772 pub cylinder_head_temperature: f32,
10773 #[doc = "Ignition timing (Crank angle degrees)"]
10774 pub ignition_timing: f32,
10775 #[doc = "Injection time"]
10776 pub injection_time: f32,
10777 #[doc = "Exhaust gas temperature"]
10778 pub exhaust_gas_temperature: f32,
10779 #[doc = "Output throttle"]
10780 pub throttle_out: f32,
10781 #[doc = "Pressure/temperature compensation"]
10782 pub pt_compensation: f32,
10783 #[doc = "EFI health status"]
10784 pub health: u8,
10785 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10786 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10787 pub ignition_voltage: f32,
10788 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10789 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10790 pub fuel_pressure: f32,
10791}
10792impl EFI_STATUS_DATA {
10793 pub const ENCODED_LEN: usize = 73usize;
10794 pub const DEFAULT: Self = Self {
10795 ecu_index: 0.0_f32,
10796 rpm: 0.0_f32,
10797 fuel_consumed: 0.0_f32,
10798 fuel_flow: 0.0_f32,
10799 engine_load: 0.0_f32,
10800 throttle_position: 0.0_f32,
10801 spark_dwell_time: 0.0_f32,
10802 barometric_pressure: 0.0_f32,
10803 intake_manifold_pressure: 0.0_f32,
10804 intake_manifold_temperature: 0.0_f32,
10805 cylinder_head_temperature: 0.0_f32,
10806 ignition_timing: 0.0_f32,
10807 injection_time: 0.0_f32,
10808 exhaust_gas_temperature: 0.0_f32,
10809 throttle_out: 0.0_f32,
10810 pt_compensation: 0.0_f32,
10811 health: 0_u8,
10812 ignition_voltage: 0.0_f32,
10813 fuel_pressure: 0.0_f32,
10814 };
10815 #[cfg(feature = "arbitrary")]
10816 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10817 use arbitrary::{Arbitrary, Unstructured};
10818 let mut buf = [0u8; 1024];
10819 rng.fill_bytes(&mut buf);
10820 let mut unstructured = Unstructured::new(&buf);
10821 Self::arbitrary(&mut unstructured).unwrap_or_default()
10822 }
10823}
10824impl Default for EFI_STATUS_DATA {
10825 fn default() -> Self {
10826 Self::DEFAULT.clone()
10827 }
10828}
10829impl MessageData for EFI_STATUS_DATA {
10830 type Message = MavMessage;
10831 const ID: u32 = 225u32;
10832 const NAME: &'static str = "EFI_STATUS";
10833 const EXTRA_CRC: u8 = 208u8;
10834 const ENCODED_LEN: usize = 73usize;
10835 fn deser(
10836 _version: MavlinkVersion,
10837 __input: &[u8],
10838 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10839 let avail_len = __input.len();
10840 let mut payload_buf = [0; Self::ENCODED_LEN];
10841 let mut buf = if avail_len < Self::ENCODED_LEN {
10842 payload_buf[0..avail_len].copy_from_slice(__input);
10843 Bytes::new(&payload_buf)
10844 } else {
10845 Bytes::new(__input)
10846 };
10847 let mut __struct = Self::default();
10848 __struct.ecu_index = buf.get_f32_le();
10849 __struct.rpm = buf.get_f32_le();
10850 __struct.fuel_consumed = buf.get_f32_le();
10851 __struct.fuel_flow = buf.get_f32_le();
10852 __struct.engine_load = buf.get_f32_le();
10853 __struct.throttle_position = buf.get_f32_le();
10854 __struct.spark_dwell_time = buf.get_f32_le();
10855 __struct.barometric_pressure = buf.get_f32_le();
10856 __struct.intake_manifold_pressure = buf.get_f32_le();
10857 __struct.intake_manifold_temperature = buf.get_f32_le();
10858 __struct.cylinder_head_temperature = buf.get_f32_le();
10859 __struct.ignition_timing = buf.get_f32_le();
10860 __struct.injection_time = buf.get_f32_le();
10861 __struct.exhaust_gas_temperature = buf.get_f32_le();
10862 __struct.throttle_out = buf.get_f32_le();
10863 __struct.pt_compensation = buf.get_f32_le();
10864 __struct.health = buf.get_u8();
10865 __struct.ignition_voltage = buf.get_f32_le();
10866 __struct.fuel_pressure = buf.get_f32_le();
10867 Ok(__struct)
10868 }
10869 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10870 let mut __tmp = BytesMut::new(bytes);
10871 #[allow(clippy::absurd_extreme_comparisons)]
10872 #[allow(unused_comparisons)]
10873 if __tmp.remaining() < Self::ENCODED_LEN {
10874 panic!(
10875 "buffer is too small (need {} bytes, but got {})",
10876 Self::ENCODED_LEN,
10877 __tmp.remaining(),
10878 )
10879 }
10880 __tmp.put_f32_le(self.ecu_index);
10881 __tmp.put_f32_le(self.rpm);
10882 __tmp.put_f32_le(self.fuel_consumed);
10883 __tmp.put_f32_le(self.fuel_flow);
10884 __tmp.put_f32_le(self.engine_load);
10885 __tmp.put_f32_le(self.throttle_position);
10886 __tmp.put_f32_le(self.spark_dwell_time);
10887 __tmp.put_f32_le(self.barometric_pressure);
10888 __tmp.put_f32_le(self.intake_manifold_pressure);
10889 __tmp.put_f32_le(self.intake_manifold_temperature);
10890 __tmp.put_f32_le(self.cylinder_head_temperature);
10891 __tmp.put_f32_le(self.ignition_timing);
10892 __tmp.put_f32_le(self.injection_time);
10893 __tmp.put_f32_le(self.exhaust_gas_temperature);
10894 __tmp.put_f32_le(self.throttle_out);
10895 __tmp.put_f32_le(self.pt_compensation);
10896 __tmp.put_u8(self.health);
10897 __tmp.put_f32_le(self.ignition_voltage);
10898 __tmp.put_f32_le(self.fuel_pressure);
10899 if matches!(version, MavlinkVersion::V2) {
10900 let len = __tmp.len();
10901 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10902 } else {
10903 __tmp.len()
10904 }
10905 }
10906}
10907#[doc = "id: 131"]
10908#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10909#[derive(Debug, Clone, PartialEq)]
10910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10912pub struct ENCAPSULATED_DATA_DATA {
10913 #[doc = "sequence number (starting with 0 on every transmission)"]
10914 pub seqnr: u16,
10915 #[doc = "image data bytes"]
10916 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10917 pub data: [u8; 253],
10918}
10919impl ENCAPSULATED_DATA_DATA {
10920 pub const ENCODED_LEN: usize = 255usize;
10921 pub const DEFAULT: Self = Self {
10922 seqnr: 0_u16,
10923 data: [0_u8; 253usize],
10924 };
10925 #[cfg(feature = "arbitrary")]
10926 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10927 use arbitrary::{Arbitrary, Unstructured};
10928 let mut buf = [0u8; 1024];
10929 rng.fill_bytes(&mut buf);
10930 let mut unstructured = Unstructured::new(&buf);
10931 Self::arbitrary(&mut unstructured).unwrap_or_default()
10932 }
10933}
10934impl Default for ENCAPSULATED_DATA_DATA {
10935 fn default() -> Self {
10936 Self::DEFAULT.clone()
10937 }
10938}
10939impl MessageData for ENCAPSULATED_DATA_DATA {
10940 type Message = MavMessage;
10941 const ID: u32 = 131u32;
10942 const NAME: &'static str = "ENCAPSULATED_DATA";
10943 const EXTRA_CRC: u8 = 223u8;
10944 const ENCODED_LEN: usize = 255usize;
10945 fn deser(
10946 _version: MavlinkVersion,
10947 __input: &[u8],
10948 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10949 let avail_len = __input.len();
10950 let mut payload_buf = [0; Self::ENCODED_LEN];
10951 let mut buf = if avail_len < Self::ENCODED_LEN {
10952 payload_buf[0..avail_len].copy_from_slice(__input);
10953 Bytes::new(&payload_buf)
10954 } else {
10955 Bytes::new(__input)
10956 };
10957 let mut __struct = Self::default();
10958 __struct.seqnr = buf.get_u16_le();
10959 for v in &mut __struct.data {
10960 let val = buf.get_u8();
10961 *v = val;
10962 }
10963 Ok(__struct)
10964 }
10965 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10966 let mut __tmp = BytesMut::new(bytes);
10967 #[allow(clippy::absurd_extreme_comparisons)]
10968 #[allow(unused_comparisons)]
10969 if __tmp.remaining() < Self::ENCODED_LEN {
10970 panic!(
10971 "buffer is too small (need {} bytes, but got {})",
10972 Self::ENCODED_LEN,
10973 __tmp.remaining(),
10974 )
10975 }
10976 __tmp.put_u16_le(self.seqnr);
10977 for val in &self.data {
10978 __tmp.put_u8(*val);
10979 }
10980 if matches!(version, MavlinkVersion::V2) {
10981 let len = __tmp.len();
10982 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10983 } else {
10984 __tmp.len()
10985 }
10986 }
10987}
10988#[doc = "id: 290"]
10989#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
10990#[derive(Debug, Clone, PartialEq)]
10991#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10993pub struct ESC_INFO_DATA {
10994 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10995 pub time_usec: u64,
10996 #[doc = "Number of reported errors by each ESC since boot."]
10997 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10998 pub error_count: [u32; 4],
10999 #[doc = "Counter of data packets received."]
11000 pub counter: u16,
11001 #[doc = "Bitmap of ESC failure flags."]
11002 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11003 pub failure_flags: [u16; 4],
11004 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11005 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11006 pub temperature: [i16; 4],
11007 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11008 pub index: u8,
11009 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11010 pub count: u8,
11011 #[doc = "Connection type protocol for all ESC."]
11012 pub connection_type: EscConnectionType,
11013 #[doc = "Information regarding online/offline status of each ESC."]
11014 pub info: u8,
11015}
11016impl ESC_INFO_DATA {
11017 pub const ENCODED_LEN: usize = 46usize;
11018 pub const DEFAULT: Self = Self {
11019 time_usec: 0_u64,
11020 error_count: [0_u32; 4usize],
11021 counter: 0_u16,
11022 failure_flags: [0_u16; 4usize],
11023 temperature: [0_i16; 4usize],
11024 index: 0_u8,
11025 count: 0_u8,
11026 connection_type: EscConnectionType::DEFAULT,
11027 info: 0_u8,
11028 };
11029 #[cfg(feature = "arbitrary")]
11030 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11031 use arbitrary::{Arbitrary, Unstructured};
11032 let mut buf = [0u8; 1024];
11033 rng.fill_bytes(&mut buf);
11034 let mut unstructured = Unstructured::new(&buf);
11035 Self::arbitrary(&mut unstructured).unwrap_or_default()
11036 }
11037}
11038impl Default for ESC_INFO_DATA {
11039 fn default() -> Self {
11040 Self::DEFAULT.clone()
11041 }
11042}
11043impl MessageData for ESC_INFO_DATA {
11044 type Message = MavMessage;
11045 const ID: u32 = 290u32;
11046 const NAME: &'static str = "ESC_INFO";
11047 const EXTRA_CRC: u8 = 251u8;
11048 const ENCODED_LEN: usize = 46usize;
11049 fn deser(
11050 _version: MavlinkVersion,
11051 __input: &[u8],
11052 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11053 let avail_len = __input.len();
11054 let mut payload_buf = [0; Self::ENCODED_LEN];
11055 let mut buf = if avail_len < Self::ENCODED_LEN {
11056 payload_buf[0..avail_len].copy_from_slice(__input);
11057 Bytes::new(&payload_buf)
11058 } else {
11059 Bytes::new(__input)
11060 };
11061 let mut __struct = Self::default();
11062 __struct.time_usec = buf.get_u64_le();
11063 for v in &mut __struct.error_count {
11064 let val = buf.get_u32_le();
11065 *v = val;
11066 }
11067 __struct.counter = buf.get_u16_le();
11068 for v in &mut __struct.failure_flags {
11069 let val = buf.get_u16_le();
11070 *v = val;
11071 }
11072 for v in &mut __struct.temperature {
11073 let val = buf.get_i16_le();
11074 *v = val;
11075 }
11076 __struct.index = buf.get_u8();
11077 __struct.count = buf.get_u8();
11078 let tmp = buf.get_u8();
11079 __struct.connection_type =
11080 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11081 enum_type: "EscConnectionType",
11082 value: tmp as u32,
11083 })?;
11084 __struct.info = buf.get_u8();
11085 Ok(__struct)
11086 }
11087 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11088 let mut __tmp = BytesMut::new(bytes);
11089 #[allow(clippy::absurd_extreme_comparisons)]
11090 #[allow(unused_comparisons)]
11091 if __tmp.remaining() < Self::ENCODED_LEN {
11092 panic!(
11093 "buffer is too small (need {} bytes, but got {})",
11094 Self::ENCODED_LEN,
11095 __tmp.remaining(),
11096 )
11097 }
11098 __tmp.put_u64_le(self.time_usec);
11099 for val in &self.error_count {
11100 __tmp.put_u32_le(*val);
11101 }
11102 __tmp.put_u16_le(self.counter);
11103 for val in &self.failure_flags {
11104 __tmp.put_u16_le(*val);
11105 }
11106 for val in &self.temperature {
11107 __tmp.put_i16_le(*val);
11108 }
11109 __tmp.put_u8(self.index);
11110 __tmp.put_u8(self.count);
11111 __tmp.put_u8(self.connection_type as u8);
11112 __tmp.put_u8(self.info);
11113 if matches!(version, MavlinkVersion::V2) {
11114 let len = __tmp.len();
11115 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11116 } else {
11117 __tmp.len()
11118 }
11119 }
11120}
11121#[doc = "id: 291"]
11122#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11123#[derive(Debug, Clone, PartialEq)]
11124#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11126pub struct ESC_STATUS_DATA {
11127 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11128 pub time_usec: u64,
11129 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11130 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11131 pub rpm: [i32; 4],
11132 #[doc = "Voltage measured from each ESC."]
11133 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11134 pub voltage: [f32; 4],
11135 #[doc = "Current measured from each ESC."]
11136 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11137 pub current: [f32; 4],
11138 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11139 pub index: u8,
11140}
11141impl ESC_STATUS_DATA {
11142 pub const ENCODED_LEN: usize = 57usize;
11143 pub const DEFAULT: Self = Self {
11144 time_usec: 0_u64,
11145 rpm: [0_i32; 4usize],
11146 voltage: [0.0_f32; 4usize],
11147 current: [0.0_f32; 4usize],
11148 index: 0_u8,
11149 };
11150 #[cfg(feature = "arbitrary")]
11151 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11152 use arbitrary::{Arbitrary, Unstructured};
11153 let mut buf = [0u8; 1024];
11154 rng.fill_bytes(&mut buf);
11155 let mut unstructured = Unstructured::new(&buf);
11156 Self::arbitrary(&mut unstructured).unwrap_or_default()
11157 }
11158}
11159impl Default for ESC_STATUS_DATA {
11160 fn default() -> Self {
11161 Self::DEFAULT.clone()
11162 }
11163}
11164impl MessageData for ESC_STATUS_DATA {
11165 type Message = MavMessage;
11166 const ID: u32 = 291u32;
11167 const NAME: &'static str = "ESC_STATUS";
11168 const EXTRA_CRC: u8 = 10u8;
11169 const ENCODED_LEN: usize = 57usize;
11170 fn deser(
11171 _version: MavlinkVersion,
11172 __input: &[u8],
11173 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11174 let avail_len = __input.len();
11175 let mut payload_buf = [0; Self::ENCODED_LEN];
11176 let mut buf = if avail_len < Self::ENCODED_LEN {
11177 payload_buf[0..avail_len].copy_from_slice(__input);
11178 Bytes::new(&payload_buf)
11179 } else {
11180 Bytes::new(__input)
11181 };
11182 let mut __struct = Self::default();
11183 __struct.time_usec = buf.get_u64_le();
11184 for v in &mut __struct.rpm {
11185 let val = buf.get_i32_le();
11186 *v = val;
11187 }
11188 for v in &mut __struct.voltage {
11189 let val = buf.get_f32_le();
11190 *v = val;
11191 }
11192 for v in &mut __struct.current {
11193 let val = buf.get_f32_le();
11194 *v = val;
11195 }
11196 __struct.index = buf.get_u8();
11197 Ok(__struct)
11198 }
11199 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11200 let mut __tmp = BytesMut::new(bytes);
11201 #[allow(clippy::absurd_extreme_comparisons)]
11202 #[allow(unused_comparisons)]
11203 if __tmp.remaining() < Self::ENCODED_LEN {
11204 panic!(
11205 "buffer is too small (need {} bytes, but got {})",
11206 Self::ENCODED_LEN,
11207 __tmp.remaining(),
11208 )
11209 }
11210 __tmp.put_u64_le(self.time_usec);
11211 for val in &self.rpm {
11212 __tmp.put_i32_le(*val);
11213 }
11214 for val in &self.voltage {
11215 __tmp.put_f32_le(*val);
11216 }
11217 for val in &self.current {
11218 __tmp.put_f32_le(*val);
11219 }
11220 __tmp.put_u8(self.index);
11221 if matches!(version, MavlinkVersion::V2) {
11222 let len = __tmp.len();
11223 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11224 } else {
11225 __tmp.len()
11226 }
11227 }
11228}
11229#[doc = "id: 230"]
11230#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11231#[derive(Debug, Clone, PartialEq)]
11232#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11233#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11234pub struct ESTIMATOR_STATUS_DATA {
11235 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11236 pub time_usec: u64,
11237 #[doc = "Velocity innovation test ratio"]
11238 pub vel_ratio: f32,
11239 #[doc = "Horizontal position innovation test ratio"]
11240 pub pos_horiz_ratio: f32,
11241 #[doc = "Vertical position innovation test ratio"]
11242 pub pos_vert_ratio: f32,
11243 #[doc = "Magnetometer innovation test ratio"]
11244 pub mag_ratio: f32,
11245 #[doc = "Height above terrain innovation test ratio"]
11246 pub hagl_ratio: f32,
11247 #[doc = "True airspeed innovation test ratio"]
11248 pub tas_ratio: f32,
11249 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11250 pub pos_horiz_accuracy: f32,
11251 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11252 pub pos_vert_accuracy: f32,
11253 #[doc = "Bitmap indicating which EKF outputs are valid."]
11254 pub flags: EstimatorStatusFlags,
11255}
11256impl ESTIMATOR_STATUS_DATA {
11257 pub const ENCODED_LEN: usize = 42usize;
11258 pub const DEFAULT: Self = Self {
11259 time_usec: 0_u64,
11260 vel_ratio: 0.0_f32,
11261 pos_horiz_ratio: 0.0_f32,
11262 pos_vert_ratio: 0.0_f32,
11263 mag_ratio: 0.0_f32,
11264 hagl_ratio: 0.0_f32,
11265 tas_ratio: 0.0_f32,
11266 pos_horiz_accuracy: 0.0_f32,
11267 pos_vert_accuracy: 0.0_f32,
11268 flags: EstimatorStatusFlags::DEFAULT,
11269 };
11270 #[cfg(feature = "arbitrary")]
11271 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11272 use arbitrary::{Arbitrary, Unstructured};
11273 let mut buf = [0u8; 1024];
11274 rng.fill_bytes(&mut buf);
11275 let mut unstructured = Unstructured::new(&buf);
11276 Self::arbitrary(&mut unstructured).unwrap_or_default()
11277 }
11278}
11279impl Default for ESTIMATOR_STATUS_DATA {
11280 fn default() -> Self {
11281 Self::DEFAULT.clone()
11282 }
11283}
11284impl MessageData for ESTIMATOR_STATUS_DATA {
11285 type Message = MavMessage;
11286 const ID: u32 = 230u32;
11287 const NAME: &'static str = "ESTIMATOR_STATUS";
11288 const EXTRA_CRC: u8 = 163u8;
11289 const ENCODED_LEN: usize = 42usize;
11290 fn deser(
11291 _version: MavlinkVersion,
11292 __input: &[u8],
11293 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11294 let avail_len = __input.len();
11295 let mut payload_buf = [0; Self::ENCODED_LEN];
11296 let mut buf = if avail_len < Self::ENCODED_LEN {
11297 payload_buf[0..avail_len].copy_from_slice(__input);
11298 Bytes::new(&payload_buf)
11299 } else {
11300 Bytes::new(__input)
11301 };
11302 let mut __struct = Self::default();
11303 __struct.time_usec = buf.get_u64_le();
11304 __struct.vel_ratio = buf.get_f32_le();
11305 __struct.pos_horiz_ratio = buf.get_f32_le();
11306 __struct.pos_vert_ratio = buf.get_f32_le();
11307 __struct.mag_ratio = buf.get_f32_le();
11308 __struct.hagl_ratio = buf.get_f32_le();
11309 __struct.tas_ratio = buf.get_f32_le();
11310 __struct.pos_horiz_accuracy = buf.get_f32_le();
11311 __struct.pos_vert_accuracy = buf.get_f32_le();
11312 let tmp = buf.get_u16_le();
11313 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11314 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11315 flag_type: "EstimatorStatusFlags",
11316 value: tmp as u32,
11317 })?;
11318 Ok(__struct)
11319 }
11320 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11321 let mut __tmp = BytesMut::new(bytes);
11322 #[allow(clippy::absurd_extreme_comparisons)]
11323 #[allow(unused_comparisons)]
11324 if __tmp.remaining() < Self::ENCODED_LEN {
11325 panic!(
11326 "buffer is too small (need {} bytes, but got {})",
11327 Self::ENCODED_LEN,
11328 __tmp.remaining(),
11329 )
11330 }
11331 __tmp.put_u64_le(self.time_usec);
11332 __tmp.put_f32_le(self.vel_ratio);
11333 __tmp.put_f32_le(self.pos_horiz_ratio);
11334 __tmp.put_f32_le(self.pos_vert_ratio);
11335 __tmp.put_f32_le(self.mag_ratio);
11336 __tmp.put_f32_le(self.hagl_ratio);
11337 __tmp.put_f32_le(self.tas_ratio);
11338 __tmp.put_f32_le(self.pos_horiz_accuracy);
11339 __tmp.put_f32_le(self.pos_vert_accuracy);
11340 __tmp.put_u16_le(self.flags.bits());
11341 if matches!(version, MavlinkVersion::V2) {
11342 let len = __tmp.len();
11343 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11344 } else {
11345 __tmp.len()
11346 }
11347 }
11348}
11349#[doc = "id: 410"]
11350#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11351#[derive(Debug, Clone, PartialEq)]
11352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11353#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11354pub struct EVENT_DATA {
11355 #[doc = "Event ID (as defined in the component metadata)"]
11356 pub id: u32,
11357 #[doc = "Timestamp (time since system boot when the event happened)."]
11358 pub event_time_boot_ms: u32,
11359 #[doc = "Sequence number."]
11360 pub sequence: u16,
11361 #[doc = "Component ID"]
11362 pub destination_component: u8,
11363 #[doc = "System ID"]
11364 pub destination_system: u8,
11365 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11366 pub log_levels: u8,
11367 #[doc = "Arguments (depend on event ID)."]
11368 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11369 pub arguments: [u8; 40],
11370}
11371impl EVENT_DATA {
11372 pub const ENCODED_LEN: usize = 53usize;
11373 pub const DEFAULT: Self = Self {
11374 id: 0_u32,
11375 event_time_boot_ms: 0_u32,
11376 sequence: 0_u16,
11377 destination_component: 0_u8,
11378 destination_system: 0_u8,
11379 log_levels: 0_u8,
11380 arguments: [0_u8; 40usize],
11381 };
11382 #[cfg(feature = "arbitrary")]
11383 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11384 use arbitrary::{Arbitrary, Unstructured};
11385 let mut buf = [0u8; 1024];
11386 rng.fill_bytes(&mut buf);
11387 let mut unstructured = Unstructured::new(&buf);
11388 Self::arbitrary(&mut unstructured).unwrap_or_default()
11389 }
11390}
11391impl Default for EVENT_DATA {
11392 fn default() -> Self {
11393 Self::DEFAULT.clone()
11394 }
11395}
11396impl MessageData for EVENT_DATA {
11397 type Message = MavMessage;
11398 const ID: u32 = 410u32;
11399 const NAME: &'static str = "EVENT";
11400 const EXTRA_CRC: u8 = 160u8;
11401 const ENCODED_LEN: usize = 53usize;
11402 fn deser(
11403 _version: MavlinkVersion,
11404 __input: &[u8],
11405 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11406 let avail_len = __input.len();
11407 let mut payload_buf = [0; Self::ENCODED_LEN];
11408 let mut buf = if avail_len < Self::ENCODED_LEN {
11409 payload_buf[0..avail_len].copy_from_slice(__input);
11410 Bytes::new(&payload_buf)
11411 } else {
11412 Bytes::new(__input)
11413 };
11414 let mut __struct = Self::default();
11415 __struct.id = buf.get_u32_le();
11416 __struct.event_time_boot_ms = buf.get_u32_le();
11417 __struct.sequence = buf.get_u16_le();
11418 __struct.destination_component = buf.get_u8();
11419 __struct.destination_system = buf.get_u8();
11420 __struct.log_levels = buf.get_u8();
11421 for v in &mut __struct.arguments {
11422 let val = buf.get_u8();
11423 *v = val;
11424 }
11425 Ok(__struct)
11426 }
11427 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11428 let mut __tmp = BytesMut::new(bytes);
11429 #[allow(clippy::absurd_extreme_comparisons)]
11430 #[allow(unused_comparisons)]
11431 if __tmp.remaining() < Self::ENCODED_LEN {
11432 panic!(
11433 "buffer is too small (need {} bytes, but got {})",
11434 Self::ENCODED_LEN,
11435 __tmp.remaining(),
11436 )
11437 }
11438 __tmp.put_u32_le(self.id);
11439 __tmp.put_u32_le(self.event_time_boot_ms);
11440 __tmp.put_u16_le(self.sequence);
11441 __tmp.put_u8(self.destination_component);
11442 __tmp.put_u8(self.destination_system);
11443 __tmp.put_u8(self.log_levels);
11444 for val in &self.arguments {
11445 __tmp.put_u8(*val);
11446 }
11447 if matches!(version, MavlinkVersion::V2) {
11448 let len = __tmp.len();
11449 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11450 } else {
11451 __tmp.len()
11452 }
11453 }
11454}
11455#[doc = "id: 245"]
11456#[doc = "Provides state for additional features."]
11457#[derive(Debug, Clone, PartialEq)]
11458#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11460pub struct EXTENDED_SYS_STATE_DATA {
11461 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11462 pub vtol_state: MavVtolState,
11463 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11464 pub landed_state: MavLandedState,
11465}
11466impl EXTENDED_SYS_STATE_DATA {
11467 pub const ENCODED_LEN: usize = 2usize;
11468 pub const DEFAULT: Self = Self {
11469 vtol_state: MavVtolState::DEFAULT,
11470 landed_state: MavLandedState::DEFAULT,
11471 };
11472 #[cfg(feature = "arbitrary")]
11473 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11474 use arbitrary::{Arbitrary, Unstructured};
11475 let mut buf = [0u8; 1024];
11476 rng.fill_bytes(&mut buf);
11477 let mut unstructured = Unstructured::new(&buf);
11478 Self::arbitrary(&mut unstructured).unwrap_or_default()
11479 }
11480}
11481impl Default for EXTENDED_SYS_STATE_DATA {
11482 fn default() -> Self {
11483 Self::DEFAULT.clone()
11484 }
11485}
11486impl MessageData for EXTENDED_SYS_STATE_DATA {
11487 type Message = MavMessage;
11488 const ID: u32 = 245u32;
11489 const NAME: &'static str = "EXTENDED_SYS_STATE";
11490 const EXTRA_CRC: u8 = 130u8;
11491 const ENCODED_LEN: usize = 2usize;
11492 fn deser(
11493 _version: MavlinkVersion,
11494 __input: &[u8],
11495 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11496 let avail_len = __input.len();
11497 let mut payload_buf = [0; Self::ENCODED_LEN];
11498 let mut buf = if avail_len < Self::ENCODED_LEN {
11499 payload_buf[0..avail_len].copy_from_slice(__input);
11500 Bytes::new(&payload_buf)
11501 } else {
11502 Bytes::new(__input)
11503 };
11504 let mut __struct = Self::default();
11505 let tmp = buf.get_u8();
11506 __struct.vtol_state =
11507 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11508 enum_type: "MavVtolState",
11509 value: tmp as u32,
11510 })?;
11511 let tmp = buf.get_u8();
11512 __struct.landed_state =
11513 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11514 enum_type: "MavLandedState",
11515 value: tmp as u32,
11516 })?;
11517 Ok(__struct)
11518 }
11519 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11520 let mut __tmp = BytesMut::new(bytes);
11521 #[allow(clippy::absurd_extreme_comparisons)]
11522 #[allow(unused_comparisons)]
11523 if __tmp.remaining() < Self::ENCODED_LEN {
11524 panic!(
11525 "buffer is too small (need {} bytes, but got {})",
11526 Self::ENCODED_LEN,
11527 __tmp.remaining(),
11528 )
11529 }
11530 __tmp.put_u8(self.vtol_state as u8);
11531 __tmp.put_u8(self.landed_state as u8);
11532 if matches!(version, MavlinkVersion::V2) {
11533 let len = __tmp.len();
11534 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11535 } else {
11536 __tmp.len()
11537 }
11538 }
11539}
11540#[doc = "id: 162"]
11541#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11542#[derive(Debug, Clone, PartialEq)]
11543#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11544#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11545pub struct FENCE_STATUS_DATA {
11546 #[doc = "Time (since boot) of last breach."]
11547 pub breach_time: u32,
11548 #[doc = "Number of fence breaches."]
11549 pub breach_count: u16,
11550 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11551 pub breach_status: u8,
11552 #[doc = "Last breach type."]
11553 pub breach_type: FenceBreach,
11554 #[doc = "Active action to prevent fence breach"]
11555 #[cfg_attr(feature = "serde", serde(default))]
11556 pub breach_mitigation: FenceMitigate,
11557}
11558impl FENCE_STATUS_DATA {
11559 pub const ENCODED_LEN: usize = 9usize;
11560 pub const DEFAULT: Self = Self {
11561 breach_time: 0_u32,
11562 breach_count: 0_u16,
11563 breach_status: 0_u8,
11564 breach_type: FenceBreach::DEFAULT,
11565 breach_mitigation: FenceMitigate::DEFAULT,
11566 };
11567 #[cfg(feature = "arbitrary")]
11568 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11569 use arbitrary::{Arbitrary, Unstructured};
11570 let mut buf = [0u8; 1024];
11571 rng.fill_bytes(&mut buf);
11572 let mut unstructured = Unstructured::new(&buf);
11573 Self::arbitrary(&mut unstructured).unwrap_or_default()
11574 }
11575}
11576impl Default for FENCE_STATUS_DATA {
11577 fn default() -> Self {
11578 Self::DEFAULT.clone()
11579 }
11580}
11581impl MessageData for FENCE_STATUS_DATA {
11582 type Message = MavMessage;
11583 const ID: u32 = 162u32;
11584 const NAME: &'static str = "FENCE_STATUS";
11585 const EXTRA_CRC: u8 = 189u8;
11586 const ENCODED_LEN: usize = 9usize;
11587 fn deser(
11588 _version: MavlinkVersion,
11589 __input: &[u8],
11590 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11591 let avail_len = __input.len();
11592 let mut payload_buf = [0; Self::ENCODED_LEN];
11593 let mut buf = if avail_len < Self::ENCODED_LEN {
11594 payload_buf[0..avail_len].copy_from_slice(__input);
11595 Bytes::new(&payload_buf)
11596 } else {
11597 Bytes::new(__input)
11598 };
11599 let mut __struct = Self::default();
11600 __struct.breach_time = buf.get_u32_le();
11601 __struct.breach_count = buf.get_u16_le();
11602 __struct.breach_status = buf.get_u8();
11603 let tmp = buf.get_u8();
11604 __struct.breach_type =
11605 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11606 enum_type: "FenceBreach",
11607 value: tmp as u32,
11608 })?;
11609 let tmp = buf.get_u8();
11610 __struct.breach_mitigation =
11611 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11612 enum_type: "FenceMitigate",
11613 value: tmp as u32,
11614 })?;
11615 Ok(__struct)
11616 }
11617 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11618 let mut __tmp = BytesMut::new(bytes);
11619 #[allow(clippy::absurd_extreme_comparisons)]
11620 #[allow(unused_comparisons)]
11621 if __tmp.remaining() < Self::ENCODED_LEN {
11622 panic!(
11623 "buffer is too small (need {} bytes, but got {})",
11624 Self::ENCODED_LEN,
11625 __tmp.remaining(),
11626 )
11627 }
11628 __tmp.put_u32_le(self.breach_time);
11629 __tmp.put_u16_le(self.breach_count);
11630 __tmp.put_u8(self.breach_status);
11631 __tmp.put_u8(self.breach_type as u8);
11632 __tmp.put_u8(self.breach_mitigation as u8);
11633 if matches!(version, MavlinkVersion::V2) {
11634 let len = __tmp.len();
11635 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11636 } else {
11637 __tmp.len()
11638 }
11639 }
11640}
11641#[doc = "id: 361"]
11642#[doc = "Vehicle status report that is sent out while figure eight execution is in progress (see MAV_CMD_DO_FIGURE_EIGHT). This may typically send at low rates: of the order of 2Hz."]
11643#[derive(Debug, Clone, PartialEq)]
11644#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11645#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11646pub struct FIGURE_EIGHT_EXECUTION_STATUS_DATA {
11647 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11648 pub time_usec: u64,
11649 #[doc = "Major axis radius of the figure eight. Positive: orbit the north circle clockwise. Negative: orbit the north circle counter-clockwise."]
11650 pub major_radius: f32,
11651 #[doc = "Minor axis radius of the figure eight. Defines the radius of two circles that make up the figure."]
11652 pub minor_radius: f32,
11653 #[doc = "Orientation of the figure eight major axis with respect to true north in [-pi,pi)."]
11654 pub orientation: f32,
11655 #[doc = "X coordinate of center point. Coordinate system depends on frame field."]
11656 pub x: i32,
11657 #[doc = "Y coordinate of center point. Coordinate system depends on frame field."]
11658 pub y: i32,
11659 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
11660 pub z: f32,
11661 #[doc = "The coordinate system of the fields: x, y, z."]
11662 pub frame: MavFrame,
11663}
11664impl FIGURE_EIGHT_EXECUTION_STATUS_DATA {
11665 pub const ENCODED_LEN: usize = 33usize;
11666 pub const DEFAULT: Self = Self {
11667 time_usec: 0_u64,
11668 major_radius: 0.0_f32,
11669 minor_radius: 0.0_f32,
11670 orientation: 0.0_f32,
11671 x: 0_i32,
11672 y: 0_i32,
11673 z: 0.0_f32,
11674 frame: MavFrame::DEFAULT,
11675 };
11676 #[cfg(feature = "arbitrary")]
11677 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11678 use arbitrary::{Arbitrary, Unstructured};
11679 let mut buf = [0u8; 1024];
11680 rng.fill_bytes(&mut buf);
11681 let mut unstructured = Unstructured::new(&buf);
11682 Self::arbitrary(&mut unstructured).unwrap_or_default()
11683 }
11684}
11685impl Default for FIGURE_EIGHT_EXECUTION_STATUS_DATA {
11686 fn default() -> Self {
11687 Self::DEFAULT.clone()
11688 }
11689}
11690impl MessageData for FIGURE_EIGHT_EXECUTION_STATUS_DATA {
11691 type Message = MavMessage;
11692 const ID: u32 = 361u32;
11693 const NAME: &'static str = "FIGURE_EIGHT_EXECUTION_STATUS";
11694 const EXTRA_CRC: u8 = 93u8;
11695 const ENCODED_LEN: usize = 33usize;
11696 fn deser(
11697 _version: MavlinkVersion,
11698 __input: &[u8],
11699 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11700 let avail_len = __input.len();
11701 let mut payload_buf = [0; Self::ENCODED_LEN];
11702 let mut buf = if avail_len < Self::ENCODED_LEN {
11703 payload_buf[0..avail_len].copy_from_slice(__input);
11704 Bytes::new(&payload_buf)
11705 } else {
11706 Bytes::new(__input)
11707 };
11708 let mut __struct = Self::default();
11709 __struct.time_usec = buf.get_u64_le();
11710 __struct.major_radius = buf.get_f32_le();
11711 __struct.minor_radius = buf.get_f32_le();
11712 __struct.orientation = buf.get_f32_le();
11713 __struct.x = buf.get_i32_le();
11714 __struct.y = buf.get_i32_le();
11715 __struct.z = buf.get_f32_le();
11716 let tmp = buf.get_u8();
11717 __struct.frame =
11718 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11719 enum_type: "MavFrame",
11720 value: tmp as u32,
11721 })?;
11722 Ok(__struct)
11723 }
11724 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11725 let mut __tmp = BytesMut::new(bytes);
11726 #[allow(clippy::absurd_extreme_comparisons)]
11727 #[allow(unused_comparisons)]
11728 if __tmp.remaining() < Self::ENCODED_LEN {
11729 panic!(
11730 "buffer is too small (need {} bytes, but got {})",
11731 Self::ENCODED_LEN,
11732 __tmp.remaining(),
11733 )
11734 }
11735 __tmp.put_u64_le(self.time_usec);
11736 __tmp.put_f32_le(self.major_radius);
11737 __tmp.put_f32_le(self.minor_radius);
11738 __tmp.put_f32_le(self.orientation);
11739 __tmp.put_i32_le(self.x);
11740 __tmp.put_i32_le(self.y);
11741 __tmp.put_f32_le(self.z);
11742 __tmp.put_u8(self.frame as u8);
11743 if matches!(version, MavlinkVersion::V2) {
11744 let len = __tmp.len();
11745 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11746 } else {
11747 __tmp.len()
11748 }
11749 }
11750}
11751#[doc = "id: 110"]
11752#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11753#[derive(Debug, Clone, PartialEq)]
11754#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11756pub struct FILE_TRANSFER_PROTOCOL_DATA {
11757 #[doc = "Network ID (0 for broadcast)"]
11758 pub target_network: u8,
11759 #[doc = "System ID (0 for broadcast)"]
11760 pub target_system: u8,
11761 #[doc = "Component ID (0 for broadcast)"]
11762 pub target_component: u8,
11763 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11764 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11765 pub payload: [u8; 251],
11766}
11767impl FILE_TRANSFER_PROTOCOL_DATA {
11768 pub const ENCODED_LEN: usize = 254usize;
11769 pub const DEFAULT: Self = Self {
11770 target_network: 0_u8,
11771 target_system: 0_u8,
11772 target_component: 0_u8,
11773 payload: [0_u8; 251usize],
11774 };
11775 #[cfg(feature = "arbitrary")]
11776 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11777 use arbitrary::{Arbitrary, Unstructured};
11778 let mut buf = [0u8; 1024];
11779 rng.fill_bytes(&mut buf);
11780 let mut unstructured = Unstructured::new(&buf);
11781 Self::arbitrary(&mut unstructured).unwrap_or_default()
11782 }
11783}
11784impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11785 fn default() -> Self {
11786 Self::DEFAULT.clone()
11787 }
11788}
11789impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11790 type Message = MavMessage;
11791 const ID: u32 = 110u32;
11792 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11793 const EXTRA_CRC: u8 = 84u8;
11794 const ENCODED_LEN: usize = 254usize;
11795 fn deser(
11796 _version: MavlinkVersion,
11797 __input: &[u8],
11798 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11799 let avail_len = __input.len();
11800 let mut payload_buf = [0; Self::ENCODED_LEN];
11801 let mut buf = if avail_len < Self::ENCODED_LEN {
11802 payload_buf[0..avail_len].copy_from_slice(__input);
11803 Bytes::new(&payload_buf)
11804 } else {
11805 Bytes::new(__input)
11806 };
11807 let mut __struct = Self::default();
11808 __struct.target_network = buf.get_u8();
11809 __struct.target_system = buf.get_u8();
11810 __struct.target_component = buf.get_u8();
11811 for v in &mut __struct.payload {
11812 let val = buf.get_u8();
11813 *v = val;
11814 }
11815 Ok(__struct)
11816 }
11817 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11818 let mut __tmp = BytesMut::new(bytes);
11819 #[allow(clippy::absurd_extreme_comparisons)]
11820 #[allow(unused_comparisons)]
11821 if __tmp.remaining() < Self::ENCODED_LEN {
11822 panic!(
11823 "buffer is too small (need {} bytes, but got {})",
11824 Self::ENCODED_LEN,
11825 __tmp.remaining(),
11826 )
11827 }
11828 __tmp.put_u8(self.target_network);
11829 __tmp.put_u8(self.target_system);
11830 __tmp.put_u8(self.target_component);
11831 for val in &self.payload {
11832 __tmp.put_u8(*val);
11833 }
11834 if matches!(version, MavlinkVersion::V2) {
11835 let len = __tmp.len();
11836 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11837 } else {
11838 __tmp.len()
11839 }
11840 }
11841}
11842#[doc = "id: 264"]
11843#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11844#[derive(Debug, Clone, PartialEq)]
11845#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11847pub struct FLIGHT_INFORMATION_DATA {
11848 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11849 pub arming_time_utc: u64,
11850 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11851 pub takeoff_time_utc: u64,
11852 #[doc = "Flight number. Note, field is misnamed UUID."]
11853 pub flight_uuid: u64,
11854 #[doc = "Timestamp (time since system boot)."]
11855 pub time_boot_ms: u32,
11856 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11857 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11858 pub landing_time: u32,
11859}
11860impl FLIGHT_INFORMATION_DATA {
11861 pub const ENCODED_LEN: usize = 32usize;
11862 pub const DEFAULT: Self = Self {
11863 arming_time_utc: 0_u64,
11864 takeoff_time_utc: 0_u64,
11865 flight_uuid: 0_u64,
11866 time_boot_ms: 0_u32,
11867 landing_time: 0_u32,
11868 };
11869 #[cfg(feature = "arbitrary")]
11870 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11871 use arbitrary::{Arbitrary, Unstructured};
11872 let mut buf = [0u8; 1024];
11873 rng.fill_bytes(&mut buf);
11874 let mut unstructured = Unstructured::new(&buf);
11875 Self::arbitrary(&mut unstructured).unwrap_or_default()
11876 }
11877}
11878impl Default for FLIGHT_INFORMATION_DATA {
11879 fn default() -> Self {
11880 Self::DEFAULT.clone()
11881 }
11882}
11883impl MessageData for FLIGHT_INFORMATION_DATA {
11884 type Message = MavMessage;
11885 const ID: u32 = 264u32;
11886 const NAME: &'static str = "FLIGHT_INFORMATION";
11887 const EXTRA_CRC: u8 = 49u8;
11888 const ENCODED_LEN: usize = 32usize;
11889 fn deser(
11890 _version: MavlinkVersion,
11891 __input: &[u8],
11892 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11893 let avail_len = __input.len();
11894 let mut payload_buf = [0; Self::ENCODED_LEN];
11895 let mut buf = if avail_len < Self::ENCODED_LEN {
11896 payload_buf[0..avail_len].copy_from_slice(__input);
11897 Bytes::new(&payload_buf)
11898 } else {
11899 Bytes::new(__input)
11900 };
11901 let mut __struct = Self::default();
11902 __struct.arming_time_utc = buf.get_u64_le();
11903 __struct.takeoff_time_utc = buf.get_u64_le();
11904 __struct.flight_uuid = buf.get_u64_le();
11905 __struct.time_boot_ms = buf.get_u32_le();
11906 __struct.landing_time = buf.get_u32_le();
11907 Ok(__struct)
11908 }
11909 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11910 let mut __tmp = BytesMut::new(bytes);
11911 #[allow(clippy::absurd_extreme_comparisons)]
11912 #[allow(unused_comparisons)]
11913 if __tmp.remaining() < Self::ENCODED_LEN {
11914 panic!(
11915 "buffer is too small (need {} bytes, but got {})",
11916 Self::ENCODED_LEN,
11917 __tmp.remaining(),
11918 )
11919 }
11920 __tmp.put_u64_le(self.arming_time_utc);
11921 __tmp.put_u64_le(self.takeoff_time_utc);
11922 __tmp.put_u64_le(self.flight_uuid);
11923 __tmp.put_u32_le(self.time_boot_ms);
11924 __tmp.put_u32_le(self.landing_time);
11925 if matches!(version, MavlinkVersion::V2) {
11926 let len = __tmp.len();
11927 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11928 } else {
11929 __tmp.len()
11930 }
11931 }
11932}
11933#[doc = "id: 144"]
11934#[doc = "Current motion information from a designated system."]
11935#[derive(Debug, Clone, PartialEq)]
11936#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11937#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11938pub struct FOLLOW_TARGET_DATA {
11939 #[doc = "Timestamp (time since system boot)."]
11940 pub timestamp: u64,
11941 #[doc = "button states or switches of a tracker device"]
11942 pub custom_state: u64,
11943 #[doc = "Latitude (WGS84)"]
11944 pub lat: i32,
11945 #[doc = "Longitude (WGS84)"]
11946 pub lon: i32,
11947 #[doc = "Altitude (MSL)"]
11948 pub alt: f32,
11949 #[doc = "target velocity (0,0,0) for unknown"]
11950 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11951 pub vel: [f32; 3],
11952 #[doc = "linear target acceleration (0,0,0) for unknown"]
11953 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11954 pub acc: [f32; 3],
11955 #[doc = "(0 0 0 0 for unknown)"]
11956 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11957 pub attitude_q: [f32; 4],
11958 #[doc = "(0 0 0 for unknown)"]
11959 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11960 pub rates: [f32; 3],
11961 #[doc = "eph epv"]
11962 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11963 pub position_cov: [f32; 3],
11964 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11965 pub est_capabilities: u8,
11966}
11967impl FOLLOW_TARGET_DATA {
11968 pub const ENCODED_LEN: usize = 93usize;
11969 pub const DEFAULT: Self = Self {
11970 timestamp: 0_u64,
11971 custom_state: 0_u64,
11972 lat: 0_i32,
11973 lon: 0_i32,
11974 alt: 0.0_f32,
11975 vel: [0.0_f32; 3usize],
11976 acc: [0.0_f32; 3usize],
11977 attitude_q: [0.0_f32; 4usize],
11978 rates: [0.0_f32; 3usize],
11979 position_cov: [0.0_f32; 3usize],
11980 est_capabilities: 0_u8,
11981 };
11982 #[cfg(feature = "arbitrary")]
11983 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11984 use arbitrary::{Arbitrary, Unstructured};
11985 let mut buf = [0u8; 1024];
11986 rng.fill_bytes(&mut buf);
11987 let mut unstructured = Unstructured::new(&buf);
11988 Self::arbitrary(&mut unstructured).unwrap_or_default()
11989 }
11990}
11991impl Default for FOLLOW_TARGET_DATA {
11992 fn default() -> Self {
11993 Self::DEFAULT.clone()
11994 }
11995}
11996impl MessageData for FOLLOW_TARGET_DATA {
11997 type Message = MavMessage;
11998 const ID: u32 = 144u32;
11999 const NAME: &'static str = "FOLLOW_TARGET";
12000 const EXTRA_CRC: u8 = 127u8;
12001 const ENCODED_LEN: usize = 93usize;
12002 fn deser(
12003 _version: MavlinkVersion,
12004 __input: &[u8],
12005 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12006 let avail_len = __input.len();
12007 let mut payload_buf = [0; Self::ENCODED_LEN];
12008 let mut buf = if avail_len < Self::ENCODED_LEN {
12009 payload_buf[0..avail_len].copy_from_slice(__input);
12010 Bytes::new(&payload_buf)
12011 } else {
12012 Bytes::new(__input)
12013 };
12014 let mut __struct = Self::default();
12015 __struct.timestamp = buf.get_u64_le();
12016 __struct.custom_state = buf.get_u64_le();
12017 __struct.lat = buf.get_i32_le();
12018 __struct.lon = buf.get_i32_le();
12019 __struct.alt = buf.get_f32_le();
12020 for v in &mut __struct.vel {
12021 let val = buf.get_f32_le();
12022 *v = val;
12023 }
12024 for v in &mut __struct.acc {
12025 let val = buf.get_f32_le();
12026 *v = val;
12027 }
12028 for v in &mut __struct.attitude_q {
12029 let val = buf.get_f32_le();
12030 *v = val;
12031 }
12032 for v in &mut __struct.rates {
12033 let val = buf.get_f32_le();
12034 *v = val;
12035 }
12036 for v in &mut __struct.position_cov {
12037 let val = buf.get_f32_le();
12038 *v = val;
12039 }
12040 __struct.est_capabilities = buf.get_u8();
12041 Ok(__struct)
12042 }
12043 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12044 let mut __tmp = BytesMut::new(bytes);
12045 #[allow(clippy::absurd_extreme_comparisons)]
12046 #[allow(unused_comparisons)]
12047 if __tmp.remaining() < Self::ENCODED_LEN {
12048 panic!(
12049 "buffer is too small (need {} bytes, but got {})",
12050 Self::ENCODED_LEN,
12051 __tmp.remaining(),
12052 )
12053 }
12054 __tmp.put_u64_le(self.timestamp);
12055 __tmp.put_u64_le(self.custom_state);
12056 __tmp.put_i32_le(self.lat);
12057 __tmp.put_i32_le(self.lon);
12058 __tmp.put_f32_le(self.alt);
12059 for val in &self.vel {
12060 __tmp.put_f32_le(*val);
12061 }
12062 for val in &self.acc {
12063 __tmp.put_f32_le(*val);
12064 }
12065 for val in &self.attitude_q {
12066 __tmp.put_f32_le(*val);
12067 }
12068 for val in &self.rates {
12069 __tmp.put_f32_le(*val);
12070 }
12071 for val in &self.position_cov {
12072 __tmp.put_f32_le(*val);
12073 }
12074 __tmp.put_u8(self.est_capabilities);
12075 if matches!(version, MavlinkVersion::V2) {
12076 let len = __tmp.len();
12077 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12078 } else {
12079 __tmp.len()
12080 }
12081 }
12082}
12083#[doc = "id: 371"]
12084#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12085#[derive(Debug, Clone, PartialEq)]
12086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12087#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12088pub struct FUEL_STATUS_DATA {
12089 #[doc = "Capacity when full. Must be provided."]
12090 pub maximum_fuel: f32,
12091 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12092 pub consumed_fuel: f32,
12093 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12094 pub remaining_fuel: f32,
12095 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12096 pub flow_rate: f32,
12097 #[doc = "Fuel temperature. NaN: field not provided."]
12098 pub temperature: f32,
12099 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12100 pub fuel_type: MavFuelType,
12101 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12102 pub id: u8,
12103 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12104 pub percent_remaining: u8,
12105}
12106impl FUEL_STATUS_DATA {
12107 pub const ENCODED_LEN: usize = 26usize;
12108 pub const DEFAULT: Self = Self {
12109 maximum_fuel: 0.0_f32,
12110 consumed_fuel: 0.0_f32,
12111 remaining_fuel: 0.0_f32,
12112 flow_rate: 0.0_f32,
12113 temperature: 0.0_f32,
12114 fuel_type: MavFuelType::DEFAULT,
12115 id: 0_u8,
12116 percent_remaining: 0_u8,
12117 };
12118 #[cfg(feature = "arbitrary")]
12119 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12120 use arbitrary::{Arbitrary, Unstructured};
12121 let mut buf = [0u8; 1024];
12122 rng.fill_bytes(&mut buf);
12123 let mut unstructured = Unstructured::new(&buf);
12124 Self::arbitrary(&mut unstructured).unwrap_or_default()
12125 }
12126}
12127impl Default for FUEL_STATUS_DATA {
12128 fn default() -> Self {
12129 Self::DEFAULT.clone()
12130 }
12131}
12132impl MessageData for FUEL_STATUS_DATA {
12133 type Message = MavMessage;
12134 const ID: u32 = 371u32;
12135 const NAME: &'static str = "FUEL_STATUS";
12136 const EXTRA_CRC: u8 = 10u8;
12137 const ENCODED_LEN: usize = 26usize;
12138 fn deser(
12139 _version: MavlinkVersion,
12140 __input: &[u8],
12141 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12142 let avail_len = __input.len();
12143 let mut payload_buf = [0; Self::ENCODED_LEN];
12144 let mut buf = if avail_len < Self::ENCODED_LEN {
12145 payload_buf[0..avail_len].copy_from_slice(__input);
12146 Bytes::new(&payload_buf)
12147 } else {
12148 Bytes::new(__input)
12149 };
12150 let mut __struct = Self::default();
12151 __struct.maximum_fuel = buf.get_f32_le();
12152 __struct.consumed_fuel = buf.get_f32_le();
12153 __struct.remaining_fuel = buf.get_f32_le();
12154 __struct.flow_rate = buf.get_f32_le();
12155 __struct.temperature = buf.get_f32_le();
12156 let tmp = buf.get_u32_le();
12157 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12158 ::mavlink_core::error::ParserError::InvalidEnum {
12159 enum_type: "MavFuelType",
12160 value: tmp as u32,
12161 },
12162 )?;
12163 __struct.id = buf.get_u8();
12164 __struct.percent_remaining = buf.get_u8();
12165 Ok(__struct)
12166 }
12167 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12168 let mut __tmp = BytesMut::new(bytes);
12169 #[allow(clippy::absurd_extreme_comparisons)]
12170 #[allow(unused_comparisons)]
12171 if __tmp.remaining() < Self::ENCODED_LEN {
12172 panic!(
12173 "buffer is too small (need {} bytes, but got {})",
12174 Self::ENCODED_LEN,
12175 __tmp.remaining(),
12176 )
12177 }
12178 __tmp.put_f32_le(self.maximum_fuel);
12179 __tmp.put_f32_le(self.consumed_fuel);
12180 __tmp.put_f32_le(self.remaining_fuel);
12181 __tmp.put_f32_le(self.flow_rate);
12182 __tmp.put_f32_le(self.temperature);
12183 __tmp.put_u32_le(self.fuel_type as u32);
12184 __tmp.put_u8(self.id);
12185 __tmp.put_u8(self.percent_remaining);
12186 if matches!(version, MavlinkVersion::V2) {
12187 let len = __tmp.len();
12188 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12189 } else {
12190 __tmp.len()
12191 }
12192 }
12193}
12194#[doc = "id: 373"]
12195#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12196#[derive(Debug, Clone, PartialEq)]
12197#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12198#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12199pub struct GENERATOR_STATUS_DATA {
12200 #[doc = "Status flags."]
12201 pub status: MavGeneratorStatusFlag,
12202 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12203 pub battery_current: f32,
12204 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12205 pub load_current: f32,
12206 #[doc = "The power being generated. NaN: field not provided"]
12207 pub power_generated: f32,
12208 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12209 pub bus_voltage: f32,
12210 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12211 pub bat_current_setpoint: f32,
12212 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12213 pub runtime: u32,
12214 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12215 pub time_until_maintenance: i32,
12216 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12217 pub generator_speed: u16,
12218 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12219 pub rectifier_temperature: i16,
12220 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12221 pub generator_temperature: i16,
12222}
12223impl GENERATOR_STATUS_DATA {
12224 pub const ENCODED_LEN: usize = 42usize;
12225 pub const DEFAULT: Self = Self {
12226 status: MavGeneratorStatusFlag::DEFAULT,
12227 battery_current: 0.0_f32,
12228 load_current: 0.0_f32,
12229 power_generated: 0.0_f32,
12230 bus_voltage: 0.0_f32,
12231 bat_current_setpoint: 0.0_f32,
12232 runtime: 0_u32,
12233 time_until_maintenance: 0_i32,
12234 generator_speed: 0_u16,
12235 rectifier_temperature: 0_i16,
12236 generator_temperature: 0_i16,
12237 };
12238 #[cfg(feature = "arbitrary")]
12239 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12240 use arbitrary::{Arbitrary, Unstructured};
12241 let mut buf = [0u8; 1024];
12242 rng.fill_bytes(&mut buf);
12243 let mut unstructured = Unstructured::new(&buf);
12244 Self::arbitrary(&mut unstructured).unwrap_or_default()
12245 }
12246}
12247impl Default for GENERATOR_STATUS_DATA {
12248 fn default() -> Self {
12249 Self::DEFAULT.clone()
12250 }
12251}
12252impl MessageData for GENERATOR_STATUS_DATA {
12253 type Message = MavMessage;
12254 const ID: u32 = 373u32;
12255 const NAME: &'static str = "GENERATOR_STATUS";
12256 const EXTRA_CRC: u8 = 117u8;
12257 const ENCODED_LEN: usize = 42usize;
12258 fn deser(
12259 _version: MavlinkVersion,
12260 __input: &[u8],
12261 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12262 let avail_len = __input.len();
12263 let mut payload_buf = [0; Self::ENCODED_LEN];
12264 let mut buf = if avail_len < Self::ENCODED_LEN {
12265 payload_buf[0..avail_len].copy_from_slice(__input);
12266 Bytes::new(&payload_buf)
12267 } else {
12268 Bytes::new(__input)
12269 };
12270 let mut __struct = Self::default();
12271 let tmp = buf.get_u64_le();
12272 __struct.status = MavGeneratorStatusFlag::from_bits(
12273 tmp & MavGeneratorStatusFlag::all().bits(),
12274 )
12275 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12276 flag_type: "MavGeneratorStatusFlag",
12277 value: tmp as u32,
12278 })?;
12279 __struct.battery_current = buf.get_f32_le();
12280 __struct.load_current = buf.get_f32_le();
12281 __struct.power_generated = buf.get_f32_le();
12282 __struct.bus_voltage = buf.get_f32_le();
12283 __struct.bat_current_setpoint = buf.get_f32_le();
12284 __struct.runtime = buf.get_u32_le();
12285 __struct.time_until_maintenance = buf.get_i32_le();
12286 __struct.generator_speed = buf.get_u16_le();
12287 __struct.rectifier_temperature = buf.get_i16_le();
12288 __struct.generator_temperature = buf.get_i16_le();
12289 Ok(__struct)
12290 }
12291 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12292 let mut __tmp = BytesMut::new(bytes);
12293 #[allow(clippy::absurd_extreme_comparisons)]
12294 #[allow(unused_comparisons)]
12295 if __tmp.remaining() < Self::ENCODED_LEN {
12296 panic!(
12297 "buffer is too small (need {} bytes, but got {})",
12298 Self::ENCODED_LEN,
12299 __tmp.remaining(),
12300 )
12301 }
12302 __tmp.put_u64_le(self.status.bits());
12303 __tmp.put_f32_le(self.battery_current);
12304 __tmp.put_f32_le(self.load_current);
12305 __tmp.put_f32_le(self.power_generated);
12306 __tmp.put_f32_le(self.bus_voltage);
12307 __tmp.put_f32_le(self.bat_current_setpoint);
12308 __tmp.put_u32_le(self.runtime);
12309 __tmp.put_i32_le(self.time_until_maintenance);
12310 __tmp.put_u16_le(self.generator_speed);
12311 __tmp.put_i16_le(self.rectifier_temperature);
12312 __tmp.put_i16_le(self.generator_temperature);
12313 if matches!(version, MavlinkVersion::V2) {
12314 let len = __tmp.len();
12315 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12316 } else {
12317 __tmp.len()
12318 }
12319 }
12320}
12321#[doc = "id: 285"]
12322#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12323#[derive(Debug, Clone, PartialEq)]
12324#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12326pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12327 #[doc = "Timestamp (time since system boot)."]
12328 pub time_boot_ms: u32,
12329 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12330 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12331 pub q: [f32; 4],
12332 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12333 pub angular_velocity_x: f32,
12334 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12335 pub angular_velocity_y: f32,
12336 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12337 pub angular_velocity_z: f32,
12338 #[doc = "Failure flags (0 for no failure)"]
12339 pub failure_flags: GimbalDeviceErrorFlags,
12340 #[doc = "Current gimbal flags set."]
12341 pub flags: GimbalDeviceFlags,
12342 #[doc = "System ID"]
12343 pub target_system: u8,
12344 #[doc = "Component ID"]
12345 pub target_component: u8,
12346 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12347 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12348 pub delta_yaw: f32,
12349 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12350 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12351 pub delta_yaw_velocity: f32,
12352 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12353 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12354 pub gimbal_device_id: u8,
12355}
12356impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12357 pub const ENCODED_LEN: usize = 49usize;
12358 pub const DEFAULT: Self = Self {
12359 time_boot_ms: 0_u32,
12360 q: [0.0_f32; 4usize],
12361 angular_velocity_x: 0.0_f32,
12362 angular_velocity_y: 0.0_f32,
12363 angular_velocity_z: 0.0_f32,
12364 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12365 flags: GimbalDeviceFlags::DEFAULT,
12366 target_system: 0_u8,
12367 target_component: 0_u8,
12368 delta_yaw: 0.0_f32,
12369 delta_yaw_velocity: 0.0_f32,
12370 gimbal_device_id: 0_u8,
12371 };
12372 #[cfg(feature = "arbitrary")]
12373 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12374 use arbitrary::{Arbitrary, Unstructured};
12375 let mut buf = [0u8; 1024];
12376 rng.fill_bytes(&mut buf);
12377 let mut unstructured = Unstructured::new(&buf);
12378 Self::arbitrary(&mut unstructured).unwrap_or_default()
12379 }
12380}
12381impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12382 fn default() -> Self {
12383 Self::DEFAULT.clone()
12384 }
12385}
12386impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12387 type Message = MavMessage;
12388 const ID: u32 = 285u32;
12389 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12390 const EXTRA_CRC: u8 = 137u8;
12391 const ENCODED_LEN: usize = 49usize;
12392 fn deser(
12393 _version: MavlinkVersion,
12394 __input: &[u8],
12395 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12396 let avail_len = __input.len();
12397 let mut payload_buf = [0; Self::ENCODED_LEN];
12398 let mut buf = if avail_len < Self::ENCODED_LEN {
12399 payload_buf[0..avail_len].copy_from_slice(__input);
12400 Bytes::new(&payload_buf)
12401 } else {
12402 Bytes::new(__input)
12403 };
12404 let mut __struct = Self::default();
12405 __struct.time_boot_ms = buf.get_u32_le();
12406 for v in &mut __struct.q {
12407 let val = buf.get_f32_le();
12408 *v = val;
12409 }
12410 __struct.angular_velocity_x = buf.get_f32_le();
12411 __struct.angular_velocity_y = buf.get_f32_le();
12412 __struct.angular_velocity_z = buf.get_f32_le();
12413 let tmp = buf.get_u32_le();
12414 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12415 tmp & GimbalDeviceErrorFlags::all().bits(),
12416 )
12417 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12418 flag_type: "GimbalDeviceErrorFlags",
12419 value: tmp as u32,
12420 })?;
12421 let tmp = buf.get_u16_le();
12422 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12423 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12424 flag_type: "GimbalDeviceFlags",
12425 value: tmp as u32,
12426 })?;
12427 __struct.target_system = buf.get_u8();
12428 __struct.target_component = buf.get_u8();
12429 __struct.delta_yaw = buf.get_f32_le();
12430 __struct.delta_yaw_velocity = buf.get_f32_le();
12431 __struct.gimbal_device_id = buf.get_u8();
12432 Ok(__struct)
12433 }
12434 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12435 let mut __tmp = BytesMut::new(bytes);
12436 #[allow(clippy::absurd_extreme_comparisons)]
12437 #[allow(unused_comparisons)]
12438 if __tmp.remaining() < Self::ENCODED_LEN {
12439 panic!(
12440 "buffer is too small (need {} bytes, but got {})",
12441 Self::ENCODED_LEN,
12442 __tmp.remaining(),
12443 )
12444 }
12445 __tmp.put_u32_le(self.time_boot_ms);
12446 for val in &self.q {
12447 __tmp.put_f32_le(*val);
12448 }
12449 __tmp.put_f32_le(self.angular_velocity_x);
12450 __tmp.put_f32_le(self.angular_velocity_y);
12451 __tmp.put_f32_le(self.angular_velocity_z);
12452 __tmp.put_u32_le(self.failure_flags.bits());
12453 __tmp.put_u16_le(self.flags.bits());
12454 __tmp.put_u8(self.target_system);
12455 __tmp.put_u8(self.target_component);
12456 __tmp.put_f32_le(self.delta_yaw);
12457 __tmp.put_f32_le(self.delta_yaw_velocity);
12458 __tmp.put_u8(self.gimbal_device_id);
12459 if matches!(version, MavlinkVersion::V2) {
12460 let len = __tmp.len();
12461 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12462 } else {
12463 __tmp.len()
12464 }
12465 }
12466}
12467#[doc = "id: 283"]
12468#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12469#[derive(Debug, Clone, PartialEq)]
12470#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12471#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12472pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12473 #[doc = "UID of gimbal hardware (0 if unknown)."]
12474 pub uid: u64,
12475 #[doc = "Timestamp (time since system boot)."]
12476 pub time_boot_ms: u32,
12477 #[doc = "0xff)."]
12478 pub firmware_version: u32,
12479 #[doc = "0xff)."]
12480 pub hardware_version: u32,
12481 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12482 pub roll_min: f32,
12483 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12484 pub roll_max: f32,
12485 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12486 pub pitch_min: f32,
12487 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12488 pub pitch_max: f32,
12489 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12490 pub yaw_min: f32,
12491 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12492 pub yaw_max: f32,
12493 #[doc = "Bitmap of gimbal capability flags."]
12494 pub cap_flags: GimbalDeviceCapFlags,
12495 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12496 pub custom_cap_flags: u16,
12497 #[doc = "Name of the gimbal vendor."]
12498 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12499 pub vendor_name: [u8; 32],
12500 #[doc = "Name of the gimbal model."]
12501 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12502 pub model_name: [u8; 32],
12503 #[doc = "Custom name of the gimbal given to it by the user."]
12504 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12505 pub custom_name: [u8; 32],
12506 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12507 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12508 pub gimbal_device_id: u8,
12509}
12510impl GIMBAL_DEVICE_INFORMATION_DATA {
12511 pub const ENCODED_LEN: usize = 145usize;
12512 pub const DEFAULT: Self = Self {
12513 uid: 0_u64,
12514 time_boot_ms: 0_u32,
12515 firmware_version: 0_u32,
12516 hardware_version: 0_u32,
12517 roll_min: 0.0_f32,
12518 roll_max: 0.0_f32,
12519 pitch_min: 0.0_f32,
12520 pitch_max: 0.0_f32,
12521 yaw_min: 0.0_f32,
12522 yaw_max: 0.0_f32,
12523 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12524 custom_cap_flags: 0_u16,
12525 vendor_name: [0_u8; 32usize],
12526 model_name: [0_u8; 32usize],
12527 custom_name: [0_u8; 32usize],
12528 gimbal_device_id: 0_u8,
12529 };
12530 #[cfg(feature = "arbitrary")]
12531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12532 use arbitrary::{Arbitrary, Unstructured};
12533 let mut buf = [0u8; 1024];
12534 rng.fill_bytes(&mut buf);
12535 let mut unstructured = Unstructured::new(&buf);
12536 Self::arbitrary(&mut unstructured).unwrap_or_default()
12537 }
12538}
12539impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12540 fn default() -> Self {
12541 Self::DEFAULT.clone()
12542 }
12543}
12544impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12545 type Message = MavMessage;
12546 const ID: u32 = 283u32;
12547 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12548 const EXTRA_CRC: u8 = 74u8;
12549 const ENCODED_LEN: usize = 145usize;
12550 fn deser(
12551 _version: MavlinkVersion,
12552 __input: &[u8],
12553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12554 let avail_len = __input.len();
12555 let mut payload_buf = [0; Self::ENCODED_LEN];
12556 let mut buf = if avail_len < Self::ENCODED_LEN {
12557 payload_buf[0..avail_len].copy_from_slice(__input);
12558 Bytes::new(&payload_buf)
12559 } else {
12560 Bytes::new(__input)
12561 };
12562 let mut __struct = Self::default();
12563 __struct.uid = buf.get_u64_le();
12564 __struct.time_boot_ms = buf.get_u32_le();
12565 __struct.firmware_version = buf.get_u32_le();
12566 __struct.hardware_version = buf.get_u32_le();
12567 __struct.roll_min = buf.get_f32_le();
12568 __struct.roll_max = buf.get_f32_le();
12569 __struct.pitch_min = buf.get_f32_le();
12570 __struct.pitch_max = buf.get_f32_le();
12571 __struct.yaw_min = buf.get_f32_le();
12572 __struct.yaw_max = buf.get_f32_le();
12573 let tmp = buf.get_u16_le();
12574 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12575 tmp & GimbalDeviceCapFlags::all().bits(),
12576 )
12577 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12578 flag_type: "GimbalDeviceCapFlags",
12579 value: tmp as u32,
12580 })?;
12581 __struct.custom_cap_flags = buf.get_u16_le();
12582 for v in &mut __struct.vendor_name {
12583 let val = buf.get_u8();
12584 *v = val;
12585 }
12586 for v in &mut __struct.model_name {
12587 let val = buf.get_u8();
12588 *v = val;
12589 }
12590 for v in &mut __struct.custom_name {
12591 let val = buf.get_u8();
12592 *v = val;
12593 }
12594 __struct.gimbal_device_id = buf.get_u8();
12595 Ok(__struct)
12596 }
12597 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12598 let mut __tmp = BytesMut::new(bytes);
12599 #[allow(clippy::absurd_extreme_comparisons)]
12600 #[allow(unused_comparisons)]
12601 if __tmp.remaining() < Self::ENCODED_LEN {
12602 panic!(
12603 "buffer is too small (need {} bytes, but got {})",
12604 Self::ENCODED_LEN,
12605 __tmp.remaining(),
12606 )
12607 }
12608 __tmp.put_u64_le(self.uid);
12609 __tmp.put_u32_le(self.time_boot_ms);
12610 __tmp.put_u32_le(self.firmware_version);
12611 __tmp.put_u32_le(self.hardware_version);
12612 __tmp.put_f32_le(self.roll_min);
12613 __tmp.put_f32_le(self.roll_max);
12614 __tmp.put_f32_le(self.pitch_min);
12615 __tmp.put_f32_le(self.pitch_max);
12616 __tmp.put_f32_le(self.yaw_min);
12617 __tmp.put_f32_le(self.yaw_max);
12618 __tmp.put_u16_le(self.cap_flags.bits());
12619 __tmp.put_u16_le(self.custom_cap_flags);
12620 for val in &self.vendor_name {
12621 __tmp.put_u8(*val);
12622 }
12623 for val in &self.model_name {
12624 __tmp.put_u8(*val);
12625 }
12626 for val in &self.custom_name {
12627 __tmp.put_u8(*val);
12628 }
12629 __tmp.put_u8(self.gimbal_device_id);
12630 if matches!(version, MavlinkVersion::V2) {
12631 let len = __tmp.len();
12632 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12633 } else {
12634 __tmp.len()
12635 }
12636 }
12637}
12638#[doc = "id: 284"]
12639#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12640#[derive(Debug, Clone, PartialEq)]
12641#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12642#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12643pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12644 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12645 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12646 pub q: [f32; 4],
12647 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12648 pub angular_velocity_x: f32,
12649 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12650 pub angular_velocity_y: f32,
12651 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12652 pub angular_velocity_z: f32,
12653 #[doc = "Low level gimbal flags."]
12654 pub flags: GimbalDeviceFlags,
12655 #[doc = "System ID"]
12656 pub target_system: u8,
12657 #[doc = "Component ID"]
12658 pub target_component: u8,
12659}
12660impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12661 pub const ENCODED_LEN: usize = 32usize;
12662 pub const DEFAULT: Self = Self {
12663 q: [0.0_f32; 4usize],
12664 angular_velocity_x: 0.0_f32,
12665 angular_velocity_y: 0.0_f32,
12666 angular_velocity_z: 0.0_f32,
12667 flags: GimbalDeviceFlags::DEFAULT,
12668 target_system: 0_u8,
12669 target_component: 0_u8,
12670 };
12671 #[cfg(feature = "arbitrary")]
12672 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12673 use arbitrary::{Arbitrary, Unstructured};
12674 let mut buf = [0u8; 1024];
12675 rng.fill_bytes(&mut buf);
12676 let mut unstructured = Unstructured::new(&buf);
12677 Self::arbitrary(&mut unstructured).unwrap_or_default()
12678 }
12679}
12680impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12681 fn default() -> Self {
12682 Self::DEFAULT.clone()
12683 }
12684}
12685impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12686 type Message = MavMessage;
12687 const ID: u32 = 284u32;
12688 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12689 const EXTRA_CRC: u8 = 99u8;
12690 const ENCODED_LEN: usize = 32usize;
12691 fn deser(
12692 _version: MavlinkVersion,
12693 __input: &[u8],
12694 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12695 let avail_len = __input.len();
12696 let mut payload_buf = [0; Self::ENCODED_LEN];
12697 let mut buf = if avail_len < Self::ENCODED_LEN {
12698 payload_buf[0..avail_len].copy_from_slice(__input);
12699 Bytes::new(&payload_buf)
12700 } else {
12701 Bytes::new(__input)
12702 };
12703 let mut __struct = Self::default();
12704 for v in &mut __struct.q {
12705 let val = buf.get_f32_le();
12706 *v = val;
12707 }
12708 __struct.angular_velocity_x = buf.get_f32_le();
12709 __struct.angular_velocity_y = buf.get_f32_le();
12710 __struct.angular_velocity_z = buf.get_f32_le();
12711 let tmp = buf.get_u16_le();
12712 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12713 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12714 flag_type: "GimbalDeviceFlags",
12715 value: tmp as u32,
12716 })?;
12717 __struct.target_system = buf.get_u8();
12718 __struct.target_component = buf.get_u8();
12719 Ok(__struct)
12720 }
12721 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12722 let mut __tmp = BytesMut::new(bytes);
12723 #[allow(clippy::absurd_extreme_comparisons)]
12724 #[allow(unused_comparisons)]
12725 if __tmp.remaining() < Self::ENCODED_LEN {
12726 panic!(
12727 "buffer is too small (need {} bytes, but got {})",
12728 Self::ENCODED_LEN,
12729 __tmp.remaining(),
12730 )
12731 }
12732 for val in &self.q {
12733 __tmp.put_f32_le(*val);
12734 }
12735 __tmp.put_f32_le(self.angular_velocity_x);
12736 __tmp.put_f32_le(self.angular_velocity_y);
12737 __tmp.put_f32_le(self.angular_velocity_z);
12738 __tmp.put_u16_le(self.flags.bits());
12739 __tmp.put_u8(self.target_system);
12740 __tmp.put_u8(self.target_component);
12741 if matches!(version, MavlinkVersion::V2) {
12742 let len = __tmp.len();
12743 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12744 } else {
12745 __tmp.len()
12746 }
12747 }
12748}
12749#[doc = "id: 280"]
12750#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12751#[derive(Debug, Clone, PartialEq)]
12752#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12753#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12754pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12755 #[doc = "Timestamp (time since system boot)."]
12756 pub time_boot_ms: u32,
12757 #[doc = "Bitmap of gimbal capability flags."]
12758 pub cap_flags: GimbalManagerCapFlags,
12759 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12760 pub roll_min: f32,
12761 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12762 pub roll_max: f32,
12763 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12764 pub pitch_min: f32,
12765 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12766 pub pitch_max: f32,
12767 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12768 pub yaw_min: f32,
12769 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12770 pub yaw_max: f32,
12771 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12772 pub gimbal_device_id: u8,
12773}
12774impl GIMBAL_MANAGER_INFORMATION_DATA {
12775 pub const ENCODED_LEN: usize = 33usize;
12776 pub const DEFAULT: Self = Self {
12777 time_boot_ms: 0_u32,
12778 cap_flags: GimbalManagerCapFlags::DEFAULT,
12779 roll_min: 0.0_f32,
12780 roll_max: 0.0_f32,
12781 pitch_min: 0.0_f32,
12782 pitch_max: 0.0_f32,
12783 yaw_min: 0.0_f32,
12784 yaw_max: 0.0_f32,
12785 gimbal_device_id: 0_u8,
12786 };
12787 #[cfg(feature = "arbitrary")]
12788 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12789 use arbitrary::{Arbitrary, Unstructured};
12790 let mut buf = [0u8; 1024];
12791 rng.fill_bytes(&mut buf);
12792 let mut unstructured = Unstructured::new(&buf);
12793 Self::arbitrary(&mut unstructured).unwrap_or_default()
12794 }
12795}
12796impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12797 fn default() -> Self {
12798 Self::DEFAULT.clone()
12799 }
12800}
12801impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12802 type Message = MavMessage;
12803 const ID: u32 = 280u32;
12804 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12805 const EXTRA_CRC: u8 = 70u8;
12806 const ENCODED_LEN: usize = 33usize;
12807 fn deser(
12808 _version: MavlinkVersion,
12809 __input: &[u8],
12810 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12811 let avail_len = __input.len();
12812 let mut payload_buf = [0; Self::ENCODED_LEN];
12813 let mut buf = if avail_len < Self::ENCODED_LEN {
12814 payload_buf[0..avail_len].copy_from_slice(__input);
12815 Bytes::new(&payload_buf)
12816 } else {
12817 Bytes::new(__input)
12818 };
12819 let mut __struct = Self::default();
12820 __struct.time_boot_ms = buf.get_u32_le();
12821 let tmp = buf.get_u32_le();
12822 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12823 tmp & GimbalManagerCapFlags::all().bits(),
12824 )
12825 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12826 flag_type: "GimbalManagerCapFlags",
12827 value: tmp as u32,
12828 })?;
12829 __struct.roll_min = buf.get_f32_le();
12830 __struct.roll_max = buf.get_f32_le();
12831 __struct.pitch_min = buf.get_f32_le();
12832 __struct.pitch_max = buf.get_f32_le();
12833 __struct.yaw_min = buf.get_f32_le();
12834 __struct.yaw_max = buf.get_f32_le();
12835 __struct.gimbal_device_id = buf.get_u8();
12836 Ok(__struct)
12837 }
12838 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12839 let mut __tmp = BytesMut::new(bytes);
12840 #[allow(clippy::absurd_extreme_comparisons)]
12841 #[allow(unused_comparisons)]
12842 if __tmp.remaining() < Self::ENCODED_LEN {
12843 panic!(
12844 "buffer is too small (need {} bytes, but got {})",
12845 Self::ENCODED_LEN,
12846 __tmp.remaining(),
12847 )
12848 }
12849 __tmp.put_u32_le(self.time_boot_ms);
12850 __tmp.put_u32_le(self.cap_flags.bits());
12851 __tmp.put_f32_le(self.roll_min);
12852 __tmp.put_f32_le(self.roll_max);
12853 __tmp.put_f32_le(self.pitch_min);
12854 __tmp.put_f32_le(self.pitch_max);
12855 __tmp.put_f32_le(self.yaw_min);
12856 __tmp.put_f32_le(self.yaw_max);
12857 __tmp.put_u8(self.gimbal_device_id);
12858 if matches!(version, MavlinkVersion::V2) {
12859 let len = __tmp.len();
12860 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12861 } else {
12862 __tmp.len()
12863 }
12864 }
12865}
12866#[doc = "id: 282"]
12867#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12868#[derive(Debug, Clone, PartialEq)]
12869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12870#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12871pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12872 #[doc = "High level gimbal manager flags to use."]
12873 pub flags: GimbalManagerFlags,
12874 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12875 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12876 pub q: [f32; 4],
12877 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12878 pub angular_velocity_x: f32,
12879 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12880 pub angular_velocity_y: f32,
12881 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12882 pub angular_velocity_z: f32,
12883 #[doc = "System ID"]
12884 pub target_system: u8,
12885 #[doc = "Component ID"]
12886 pub target_component: u8,
12887 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12888 pub gimbal_device_id: u8,
12889}
12890impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12891 pub const ENCODED_LEN: usize = 35usize;
12892 pub const DEFAULT: Self = Self {
12893 flags: GimbalManagerFlags::DEFAULT,
12894 q: [0.0_f32; 4usize],
12895 angular_velocity_x: 0.0_f32,
12896 angular_velocity_y: 0.0_f32,
12897 angular_velocity_z: 0.0_f32,
12898 target_system: 0_u8,
12899 target_component: 0_u8,
12900 gimbal_device_id: 0_u8,
12901 };
12902 #[cfg(feature = "arbitrary")]
12903 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12904 use arbitrary::{Arbitrary, Unstructured};
12905 let mut buf = [0u8; 1024];
12906 rng.fill_bytes(&mut buf);
12907 let mut unstructured = Unstructured::new(&buf);
12908 Self::arbitrary(&mut unstructured).unwrap_or_default()
12909 }
12910}
12911impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12912 fn default() -> Self {
12913 Self::DEFAULT.clone()
12914 }
12915}
12916impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12917 type Message = MavMessage;
12918 const ID: u32 = 282u32;
12919 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12920 const EXTRA_CRC: u8 = 123u8;
12921 const ENCODED_LEN: usize = 35usize;
12922 fn deser(
12923 _version: MavlinkVersion,
12924 __input: &[u8],
12925 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12926 let avail_len = __input.len();
12927 let mut payload_buf = [0; Self::ENCODED_LEN];
12928 let mut buf = if avail_len < Self::ENCODED_LEN {
12929 payload_buf[0..avail_len].copy_from_slice(__input);
12930 Bytes::new(&payload_buf)
12931 } else {
12932 Bytes::new(__input)
12933 };
12934 let mut __struct = Self::default();
12935 let tmp = buf.get_u32_le();
12936 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12937 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12938 flag_type: "GimbalManagerFlags",
12939 value: tmp as u32,
12940 })?;
12941 for v in &mut __struct.q {
12942 let val = buf.get_f32_le();
12943 *v = val;
12944 }
12945 __struct.angular_velocity_x = buf.get_f32_le();
12946 __struct.angular_velocity_y = buf.get_f32_le();
12947 __struct.angular_velocity_z = buf.get_f32_le();
12948 __struct.target_system = buf.get_u8();
12949 __struct.target_component = buf.get_u8();
12950 __struct.gimbal_device_id = buf.get_u8();
12951 Ok(__struct)
12952 }
12953 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12954 let mut __tmp = BytesMut::new(bytes);
12955 #[allow(clippy::absurd_extreme_comparisons)]
12956 #[allow(unused_comparisons)]
12957 if __tmp.remaining() < Self::ENCODED_LEN {
12958 panic!(
12959 "buffer is too small (need {} bytes, but got {})",
12960 Self::ENCODED_LEN,
12961 __tmp.remaining(),
12962 )
12963 }
12964 __tmp.put_u32_le(self.flags.bits());
12965 for val in &self.q {
12966 __tmp.put_f32_le(*val);
12967 }
12968 __tmp.put_f32_le(self.angular_velocity_x);
12969 __tmp.put_f32_le(self.angular_velocity_y);
12970 __tmp.put_f32_le(self.angular_velocity_z);
12971 __tmp.put_u8(self.target_system);
12972 __tmp.put_u8(self.target_component);
12973 __tmp.put_u8(self.gimbal_device_id);
12974 if matches!(version, MavlinkVersion::V2) {
12975 let len = __tmp.len();
12976 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12977 } else {
12978 __tmp.len()
12979 }
12980 }
12981}
12982#[doc = "id: 288"]
12983#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12984#[derive(Debug, Clone, PartialEq)]
12985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12987pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12988 #[doc = "High level gimbal manager flags."]
12989 pub flags: GimbalManagerFlags,
12990 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12991 pub pitch: f32,
12992 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12993 pub yaw: f32,
12994 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12995 pub pitch_rate: f32,
12996 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12997 pub yaw_rate: f32,
12998 #[doc = "System ID"]
12999 pub target_system: u8,
13000 #[doc = "Component ID"]
13001 pub target_component: u8,
13002 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13003 pub gimbal_device_id: u8,
13004}
13005impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13006 pub const ENCODED_LEN: usize = 23usize;
13007 pub const DEFAULT: Self = Self {
13008 flags: GimbalManagerFlags::DEFAULT,
13009 pitch: 0.0_f32,
13010 yaw: 0.0_f32,
13011 pitch_rate: 0.0_f32,
13012 yaw_rate: 0.0_f32,
13013 target_system: 0_u8,
13014 target_component: 0_u8,
13015 gimbal_device_id: 0_u8,
13016 };
13017 #[cfg(feature = "arbitrary")]
13018 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13019 use arbitrary::{Arbitrary, Unstructured};
13020 let mut buf = [0u8; 1024];
13021 rng.fill_bytes(&mut buf);
13022 let mut unstructured = Unstructured::new(&buf);
13023 Self::arbitrary(&mut unstructured).unwrap_or_default()
13024 }
13025}
13026impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13027 fn default() -> Self {
13028 Self::DEFAULT.clone()
13029 }
13030}
13031impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13032 type Message = MavMessage;
13033 const ID: u32 = 288u32;
13034 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13035 const EXTRA_CRC: u8 = 20u8;
13036 const ENCODED_LEN: usize = 23usize;
13037 fn deser(
13038 _version: MavlinkVersion,
13039 __input: &[u8],
13040 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13041 let avail_len = __input.len();
13042 let mut payload_buf = [0; Self::ENCODED_LEN];
13043 let mut buf = if avail_len < Self::ENCODED_LEN {
13044 payload_buf[0..avail_len].copy_from_slice(__input);
13045 Bytes::new(&payload_buf)
13046 } else {
13047 Bytes::new(__input)
13048 };
13049 let mut __struct = Self::default();
13050 let tmp = buf.get_u32_le();
13051 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13052 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13053 flag_type: "GimbalManagerFlags",
13054 value: tmp as u32,
13055 })?;
13056 __struct.pitch = buf.get_f32_le();
13057 __struct.yaw = buf.get_f32_le();
13058 __struct.pitch_rate = buf.get_f32_le();
13059 __struct.yaw_rate = buf.get_f32_le();
13060 __struct.target_system = buf.get_u8();
13061 __struct.target_component = buf.get_u8();
13062 __struct.gimbal_device_id = buf.get_u8();
13063 Ok(__struct)
13064 }
13065 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13066 let mut __tmp = BytesMut::new(bytes);
13067 #[allow(clippy::absurd_extreme_comparisons)]
13068 #[allow(unused_comparisons)]
13069 if __tmp.remaining() < Self::ENCODED_LEN {
13070 panic!(
13071 "buffer is too small (need {} bytes, but got {})",
13072 Self::ENCODED_LEN,
13073 __tmp.remaining(),
13074 )
13075 }
13076 __tmp.put_u32_le(self.flags.bits());
13077 __tmp.put_f32_le(self.pitch);
13078 __tmp.put_f32_le(self.yaw);
13079 __tmp.put_f32_le(self.pitch_rate);
13080 __tmp.put_f32_le(self.yaw_rate);
13081 __tmp.put_u8(self.target_system);
13082 __tmp.put_u8(self.target_component);
13083 __tmp.put_u8(self.gimbal_device_id);
13084 if matches!(version, MavlinkVersion::V2) {
13085 let len = __tmp.len();
13086 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13087 } else {
13088 __tmp.len()
13089 }
13090 }
13091}
13092#[doc = "id: 287"]
13093#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13094#[derive(Debug, Clone, PartialEq)]
13095#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13096#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13097pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13098 #[doc = "High level gimbal manager flags to use."]
13099 pub flags: GimbalManagerFlags,
13100 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13101 pub pitch: f32,
13102 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13103 pub yaw: f32,
13104 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13105 pub pitch_rate: f32,
13106 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13107 pub yaw_rate: f32,
13108 #[doc = "System ID"]
13109 pub target_system: u8,
13110 #[doc = "Component ID"]
13111 pub target_component: u8,
13112 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13113 pub gimbal_device_id: u8,
13114}
13115impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13116 pub const ENCODED_LEN: usize = 23usize;
13117 pub const DEFAULT: Self = Self {
13118 flags: GimbalManagerFlags::DEFAULT,
13119 pitch: 0.0_f32,
13120 yaw: 0.0_f32,
13121 pitch_rate: 0.0_f32,
13122 yaw_rate: 0.0_f32,
13123 target_system: 0_u8,
13124 target_component: 0_u8,
13125 gimbal_device_id: 0_u8,
13126 };
13127 #[cfg(feature = "arbitrary")]
13128 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13129 use arbitrary::{Arbitrary, Unstructured};
13130 let mut buf = [0u8; 1024];
13131 rng.fill_bytes(&mut buf);
13132 let mut unstructured = Unstructured::new(&buf);
13133 Self::arbitrary(&mut unstructured).unwrap_or_default()
13134 }
13135}
13136impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13137 fn default() -> Self {
13138 Self::DEFAULT.clone()
13139 }
13140}
13141impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13142 type Message = MavMessage;
13143 const ID: u32 = 287u32;
13144 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13145 const EXTRA_CRC: u8 = 1u8;
13146 const ENCODED_LEN: usize = 23usize;
13147 fn deser(
13148 _version: MavlinkVersion,
13149 __input: &[u8],
13150 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13151 let avail_len = __input.len();
13152 let mut payload_buf = [0; Self::ENCODED_LEN];
13153 let mut buf = if avail_len < Self::ENCODED_LEN {
13154 payload_buf[0..avail_len].copy_from_slice(__input);
13155 Bytes::new(&payload_buf)
13156 } else {
13157 Bytes::new(__input)
13158 };
13159 let mut __struct = Self::default();
13160 let tmp = buf.get_u32_le();
13161 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13162 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13163 flag_type: "GimbalManagerFlags",
13164 value: tmp as u32,
13165 })?;
13166 __struct.pitch = buf.get_f32_le();
13167 __struct.yaw = buf.get_f32_le();
13168 __struct.pitch_rate = buf.get_f32_le();
13169 __struct.yaw_rate = buf.get_f32_le();
13170 __struct.target_system = buf.get_u8();
13171 __struct.target_component = buf.get_u8();
13172 __struct.gimbal_device_id = buf.get_u8();
13173 Ok(__struct)
13174 }
13175 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13176 let mut __tmp = BytesMut::new(bytes);
13177 #[allow(clippy::absurd_extreme_comparisons)]
13178 #[allow(unused_comparisons)]
13179 if __tmp.remaining() < Self::ENCODED_LEN {
13180 panic!(
13181 "buffer is too small (need {} bytes, but got {})",
13182 Self::ENCODED_LEN,
13183 __tmp.remaining(),
13184 )
13185 }
13186 __tmp.put_u32_le(self.flags.bits());
13187 __tmp.put_f32_le(self.pitch);
13188 __tmp.put_f32_le(self.yaw);
13189 __tmp.put_f32_le(self.pitch_rate);
13190 __tmp.put_f32_le(self.yaw_rate);
13191 __tmp.put_u8(self.target_system);
13192 __tmp.put_u8(self.target_component);
13193 __tmp.put_u8(self.gimbal_device_id);
13194 if matches!(version, MavlinkVersion::V2) {
13195 let len = __tmp.len();
13196 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13197 } else {
13198 __tmp.len()
13199 }
13200 }
13201}
13202#[doc = "id: 281"]
13203#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13204#[derive(Debug, Clone, PartialEq)]
13205#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13206#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13207pub struct GIMBAL_MANAGER_STATUS_DATA {
13208 #[doc = "Timestamp (time since system boot)."]
13209 pub time_boot_ms: u32,
13210 #[doc = "High level gimbal manager flags currently applied."]
13211 pub flags: GimbalManagerFlags,
13212 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13213 pub gimbal_device_id: u8,
13214 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13215 pub primary_control_sysid: u8,
13216 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13217 pub primary_control_compid: u8,
13218 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13219 pub secondary_control_sysid: u8,
13220 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13221 pub secondary_control_compid: u8,
13222}
13223impl GIMBAL_MANAGER_STATUS_DATA {
13224 pub const ENCODED_LEN: usize = 13usize;
13225 pub const DEFAULT: Self = Self {
13226 time_boot_ms: 0_u32,
13227 flags: GimbalManagerFlags::DEFAULT,
13228 gimbal_device_id: 0_u8,
13229 primary_control_sysid: 0_u8,
13230 primary_control_compid: 0_u8,
13231 secondary_control_sysid: 0_u8,
13232 secondary_control_compid: 0_u8,
13233 };
13234 #[cfg(feature = "arbitrary")]
13235 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13236 use arbitrary::{Arbitrary, Unstructured};
13237 let mut buf = [0u8; 1024];
13238 rng.fill_bytes(&mut buf);
13239 let mut unstructured = Unstructured::new(&buf);
13240 Self::arbitrary(&mut unstructured).unwrap_or_default()
13241 }
13242}
13243impl Default for GIMBAL_MANAGER_STATUS_DATA {
13244 fn default() -> Self {
13245 Self::DEFAULT.clone()
13246 }
13247}
13248impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13249 type Message = MavMessage;
13250 const ID: u32 = 281u32;
13251 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13252 const EXTRA_CRC: u8 = 48u8;
13253 const ENCODED_LEN: usize = 13usize;
13254 fn deser(
13255 _version: MavlinkVersion,
13256 __input: &[u8],
13257 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13258 let avail_len = __input.len();
13259 let mut payload_buf = [0; Self::ENCODED_LEN];
13260 let mut buf = if avail_len < Self::ENCODED_LEN {
13261 payload_buf[0..avail_len].copy_from_slice(__input);
13262 Bytes::new(&payload_buf)
13263 } else {
13264 Bytes::new(__input)
13265 };
13266 let mut __struct = Self::default();
13267 __struct.time_boot_ms = buf.get_u32_le();
13268 let tmp = buf.get_u32_le();
13269 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13270 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13271 flag_type: "GimbalManagerFlags",
13272 value: tmp as u32,
13273 })?;
13274 __struct.gimbal_device_id = buf.get_u8();
13275 __struct.primary_control_sysid = buf.get_u8();
13276 __struct.primary_control_compid = buf.get_u8();
13277 __struct.secondary_control_sysid = buf.get_u8();
13278 __struct.secondary_control_compid = buf.get_u8();
13279 Ok(__struct)
13280 }
13281 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13282 let mut __tmp = BytesMut::new(bytes);
13283 #[allow(clippy::absurd_extreme_comparisons)]
13284 #[allow(unused_comparisons)]
13285 if __tmp.remaining() < Self::ENCODED_LEN {
13286 panic!(
13287 "buffer is too small (need {} bytes, but got {})",
13288 Self::ENCODED_LEN,
13289 __tmp.remaining(),
13290 )
13291 }
13292 __tmp.put_u32_le(self.time_boot_ms);
13293 __tmp.put_u32_le(self.flags.bits());
13294 __tmp.put_u8(self.gimbal_device_id);
13295 __tmp.put_u8(self.primary_control_sysid);
13296 __tmp.put_u8(self.primary_control_compid);
13297 __tmp.put_u8(self.secondary_control_sysid);
13298 __tmp.put_u8(self.secondary_control_compid);
13299 if matches!(version, MavlinkVersion::V2) {
13300 let len = __tmp.len();
13301 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13302 } else {
13303 __tmp.len()
13304 }
13305 }
13306}
13307#[doc = "id: 33"]
13308#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13309#[derive(Debug, Clone, PartialEq)]
13310#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13311#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13312pub struct GLOBAL_POSITION_INT_DATA {
13313 #[doc = "Timestamp (time since system boot)."]
13314 pub time_boot_ms: u32,
13315 #[doc = "Latitude, expressed"]
13316 pub lat: i32,
13317 #[doc = "Longitude, expressed"]
13318 pub lon: i32,
13319 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13320 pub alt: i32,
13321 #[doc = "Altitude above home"]
13322 pub relative_alt: i32,
13323 #[doc = "Ground X Speed (Latitude, positive north)"]
13324 pub vx: i16,
13325 #[doc = "Ground Y Speed (Longitude, positive east)"]
13326 pub vy: i16,
13327 #[doc = "Ground Z Speed (Altitude, positive down)"]
13328 pub vz: i16,
13329 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13330 pub hdg: u16,
13331}
13332impl GLOBAL_POSITION_INT_DATA {
13333 pub const ENCODED_LEN: usize = 28usize;
13334 pub const DEFAULT: Self = Self {
13335 time_boot_ms: 0_u32,
13336 lat: 0_i32,
13337 lon: 0_i32,
13338 alt: 0_i32,
13339 relative_alt: 0_i32,
13340 vx: 0_i16,
13341 vy: 0_i16,
13342 vz: 0_i16,
13343 hdg: 0_u16,
13344 };
13345 #[cfg(feature = "arbitrary")]
13346 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13347 use arbitrary::{Arbitrary, Unstructured};
13348 let mut buf = [0u8; 1024];
13349 rng.fill_bytes(&mut buf);
13350 let mut unstructured = Unstructured::new(&buf);
13351 Self::arbitrary(&mut unstructured).unwrap_or_default()
13352 }
13353}
13354impl Default for GLOBAL_POSITION_INT_DATA {
13355 fn default() -> Self {
13356 Self::DEFAULT.clone()
13357 }
13358}
13359impl MessageData for GLOBAL_POSITION_INT_DATA {
13360 type Message = MavMessage;
13361 const ID: u32 = 33u32;
13362 const NAME: &'static str = "GLOBAL_POSITION_INT";
13363 const EXTRA_CRC: u8 = 104u8;
13364 const ENCODED_LEN: usize = 28usize;
13365 fn deser(
13366 _version: MavlinkVersion,
13367 __input: &[u8],
13368 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13369 let avail_len = __input.len();
13370 let mut payload_buf = [0; Self::ENCODED_LEN];
13371 let mut buf = if avail_len < Self::ENCODED_LEN {
13372 payload_buf[0..avail_len].copy_from_slice(__input);
13373 Bytes::new(&payload_buf)
13374 } else {
13375 Bytes::new(__input)
13376 };
13377 let mut __struct = Self::default();
13378 __struct.time_boot_ms = buf.get_u32_le();
13379 __struct.lat = buf.get_i32_le();
13380 __struct.lon = buf.get_i32_le();
13381 __struct.alt = buf.get_i32_le();
13382 __struct.relative_alt = buf.get_i32_le();
13383 __struct.vx = buf.get_i16_le();
13384 __struct.vy = buf.get_i16_le();
13385 __struct.vz = buf.get_i16_le();
13386 __struct.hdg = buf.get_u16_le();
13387 Ok(__struct)
13388 }
13389 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13390 let mut __tmp = BytesMut::new(bytes);
13391 #[allow(clippy::absurd_extreme_comparisons)]
13392 #[allow(unused_comparisons)]
13393 if __tmp.remaining() < Self::ENCODED_LEN {
13394 panic!(
13395 "buffer is too small (need {} bytes, but got {})",
13396 Self::ENCODED_LEN,
13397 __tmp.remaining(),
13398 )
13399 }
13400 __tmp.put_u32_le(self.time_boot_ms);
13401 __tmp.put_i32_le(self.lat);
13402 __tmp.put_i32_le(self.lon);
13403 __tmp.put_i32_le(self.alt);
13404 __tmp.put_i32_le(self.relative_alt);
13405 __tmp.put_i16_le(self.vx);
13406 __tmp.put_i16_le(self.vy);
13407 __tmp.put_i16_le(self.vz);
13408 __tmp.put_u16_le(self.hdg);
13409 if matches!(version, MavlinkVersion::V2) {
13410 let len = __tmp.len();
13411 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13412 } else {
13413 __tmp.len()
13414 }
13415 }
13416}
13417#[doc = "id: 63"]
13418#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13419#[derive(Debug, Clone, PartialEq)]
13420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13421#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13422pub struct GLOBAL_POSITION_INT_COV_DATA {
13423 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13424 pub time_usec: u64,
13425 #[doc = "Latitude"]
13426 pub lat: i32,
13427 #[doc = "Longitude"]
13428 pub lon: i32,
13429 #[doc = "Altitude in meters above MSL"]
13430 pub alt: i32,
13431 #[doc = "Altitude above ground"]
13432 pub relative_alt: i32,
13433 #[doc = "Ground X Speed (Latitude)"]
13434 pub vx: f32,
13435 #[doc = "Ground Y Speed (Longitude)"]
13436 pub vy: f32,
13437 #[doc = "Ground Z Speed (Altitude)"]
13438 pub vz: f32,
13439 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13440 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13441 pub covariance: [f32; 36],
13442 #[doc = "Class id of the estimator this estimate originated from."]
13443 pub estimator_type: MavEstimatorType,
13444}
13445impl GLOBAL_POSITION_INT_COV_DATA {
13446 pub const ENCODED_LEN: usize = 181usize;
13447 pub const DEFAULT: Self = Self {
13448 time_usec: 0_u64,
13449 lat: 0_i32,
13450 lon: 0_i32,
13451 alt: 0_i32,
13452 relative_alt: 0_i32,
13453 vx: 0.0_f32,
13454 vy: 0.0_f32,
13455 vz: 0.0_f32,
13456 covariance: [0.0_f32; 36usize],
13457 estimator_type: MavEstimatorType::DEFAULT,
13458 };
13459 #[cfg(feature = "arbitrary")]
13460 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13461 use arbitrary::{Arbitrary, Unstructured};
13462 let mut buf = [0u8; 1024];
13463 rng.fill_bytes(&mut buf);
13464 let mut unstructured = Unstructured::new(&buf);
13465 Self::arbitrary(&mut unstructured).unwrap_or_default()
13466 }
13467}
13468impl Default for GLOBAL_POSITION_INT_COV_DATA {
13469 fn default() -> Self {
13470 Self::DEFAULT.clone()
13471 }
13472}
13473impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13474 type Message = MavMessage;
13475 const ID: u32 = 63u32;
13476 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13477 const EXTRA_CRC: u8 = 119u8;
13478 const ENCODED_LEN: usize = 181usize;
13479 fn deser(
13480 _version: MavlinkVersion,
13481 __input: &[u8],
13482 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13483 let avail_len = __input.len();
13484 let mut payload_buf = [0; Self::ENCODED_LEN];
13485 let mut buf = if avail_len < Self::ENCODED_LEN {
13486 payload_buf[0..avail_len].copy_from_slice(__input);
13487 Bytes::new(&payload_buf)
13488 } else {
13489 Bytes::new(__input)
13490 };
13491 let mut __struct = Self::default();
13492 __struct.time_usec = buf.get_u64_le();
13493 __struct.lat = buf.get_i32_le();
13494 __struct.lon = buf.get_i32_le();
13495 __struct.alt = buf.get_i32_le();
13496 __struct.relative_alt = buf.get_i32_le();
13497 __struct.vx = buf.get_f32_le();
13498 __struct.vy = buf.get_f32_le();
13499 __struct.vz = buf.get_f32_le();
13500 for v in &mut __struct.covariance {
13501 let val = buf.get_f32_le();
13502 *v = val;
13503 }
13504 let tmp = buf.get_u8();
13505 __struct.estimator_type =
13506 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13507 enum_type: "MavEstimatorType",
13508 value: tmp as u32,
13509 })?;
13510 Ok(__struct)
13511 }
13512 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13513 let mut __tmp = BytesMut::new(bytes);
13514 #[allow(clippy::absurd_extreme_comparisons)]
13515 #[allow(unused_comparisons)]
13516 if __tmp.remaining() < Self::ENCODED_LEN {
13517 panic!(
13518 "buffer is too small (need {} bytes, but got {})",
13519 Self::ENCODED_LEN,
13520 __tmp.remaining(),
13521 )
13522 }
13523 __tmp.put_u64_le(self.time_usec);
13524 __tmp.put_i32_le(self.lat);
13525 __tmp.put_i32_le(self.lon);
13526 __tmp.put_i32_le(self.alt);
13527 __tmp.put_i32_le(self.relative_alt);
13528 __tmp.put_f32_le(self.vx);
13529 __tmp.put_f32_le(self.vy);
13530 __tmp.put_f32_le(self.vz);
13531 for val in &self.covariance {
13532 __tmp.put_f32_le(*val);
13533 }
13534 __tmp.put_u8(self.estimator_type as u8);
13535 if matches!(version, MavlinkVersion::V2) {
13536 let len = __tmp.len();
13537 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13538 } else {
13539 __tmp.len()
13540 }
13541 }
13542}
13543#[doc = "id: 101"]
13544#[doc = "Global position/attitude estimate from a vision source."]
13545#[derive(Debug, Clone, PartialEq)]
13546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13547#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13548pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13549 #[doc = "Timestamp (UNIX time or since system boot)"]
13550 pub usec: u64,
13551 #[doc = "Global X position"]
13552 pub x: f32,
13553 #[doc = "Global Y position"]
13554 pub y: f32,
13555 #[doc = "Global Z position"]
13556 pub z: f32,
13557 #[doc = "Roll angle"]
13558 pub roll: f32,
13559 #[doc = "Pitch angle"]
13560 pub pitch: f32,
13561 #[doc = "Yaw angle"]
13562 pub yaw: f32,
13563 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13564 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13565 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13566 pub covariance: [f32; 21],
13567 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13568 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13569 pub reset_counter: u8,
13570}
13571impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13572 pub const ENCODED_LEN: usize = 117usize;
13573 pub const DEFAULT: Self = Self {
13574 usec: 0_u64,
13575 x: 0.0_f32,
13576 y: 0.0_f32,
13577 z: 0.0_f32,
13578 roll: 0.0_f32,
13579 pitch: 0.0_f32,
13580 yaw: 0.0_f32,
13581 covariance: [0.0_f32; 21usize],
13582 reset_counter: 0_u8,
13583 };
13584 #[cfg(feature = "arbitrary")]
13585 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13586 use arbitrary::{Arbitrary, Unstructured};
13587 let mut buf = [0u8; 1024];
13588 rng.fill_bytes(&mut buf);
13589 let mut unstructured = Unstructured::new(&buf);
13590 Self::arbitrary(&mut unstructured).unwrap_or_default()
13591 }
13592}
13593impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13594 fn default() -> Self {
13595 Self::DEFAULT.clone()
13596 }
13597}
13598impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13599 type Message = MavMessage;
13600 const ID: u32 = 101u32;
13601 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13602 const EXTRA_CRC: u8 = 102u8;
13603 const ENCODED_LEN: usize = 117usize;
13604 fn deser(
13605 _version: MavlinkVersion,
13606 __input: &[u8],
13607 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13608 let avail_len = __input.len();
13609 let mut payload_buf = [0; Self::ENCODED_LEN];
13610 let mut buf = if avail_len < Self::ENCODED_LEN {
13611 payload_buf[0..avail_len].copy_from_slice(__input);
13612 Bytes::new(&payload_buf)
13613 } else {
13614 Bytes::new(__input)
13615 };
13616 let mut __struct = Self::default();
13617 __struct.usec = buf.get_u64_le();
13618 __struct.x = buf.get_f32_le();
13619 __struct.y = buf.get_f32_le();
13620 __struct.z = buf.get_f32_le();
13621 __struct.roll = buf.get_f32_le();
13622 __struct.pitch = buf.get_f32_le();
13623 __struct.yaw = buf.get_f32_le();
13624 for v in &mut __struct.covariance {
13625 let val = buf.get_f32_le();
13626 *v = val;
13627 }
13628 __struct.reset_counter = buf.get_u8();
13629 Ok(__struct)
13630 }
13631 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13632 let mut __tmp = BytesMut::new(bytes);
13633 #[allow(clippy::absurd_extreme_comparisons)]
13634 #[allow(unused_comparisons)]
13635 if __tmp.remaining() < Self::ENCODED_LEN {
13636 panic!(
13637 "buffer is too small (need {} bytes, but got {})",
13638 Self::ENCODED_LEN,
13639 __tmp.remaining(),
13640 )
13641 }
13642 __tmp.put_u64_le(self.usec);
13643 __tmp.put_f32_le(self.x);
13644 __tmp.put_f32_le(self.y);
13645 __tmp.put_f32_le(self.z);
13646 __tmp.put_f32_le(self.roll);
13647 __tmp.put_f32_le(self.pitch);
13648 __tmp.put_f32_le(self.yaw);
13649 for val in &self.covariance {
13650 __tmp.put_f32_le(*val);
13651 }
13652 __tmp.put_u8(self.reset_counter);
13653 if matches!(version, MavlinkVersion::V2) {
13654 let len = __tmp.len();
13655 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13656 } else {
13657 __tmp.len()
13658 }
13659 }
13660}
13661#[doc = "id: 441"]
13662#[doc = "Information about key components of GNSS receivers, like signal authentication, interference and system errors."]
13663#[derive(Debug, Clone, PartialEq)]
13664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13666pub struct GNSS_INTEGRITY_DATA {
13667 #[doc = "Errors in the GPS system."]
13668 pub system_errors: GpsSystemErrorFlags,
13669 #[doc = "Horizontal expected accuracy using satellites successfully validated using RAIM."]
13670 pub raim_hfom: u16,
13671 #[doc = "Vertical expected accuracy using satellites successfully validated using RAIM."]
13672 pub raim_vfom: u16,
13673 #[doc = "GNSS receiver id. Must match instance ids of other messages from same receiver."]
13674 pub id: u8,
13675 #[doc = "Signal authentication state of the GPS system."]
13676 pub authentication_state: GpsAuthenticationState,
13677 #[doc = "Signal jamming state of the GPS system."]
13678 pub jamming_state: GpsJammingState,
13679 #[doc = "Signal spoofing state of the GPS system."]
13680 pub spoofing_state: GpsSpoofingState,
13681 #[doc = "The state of the RAIM processing."]
13682 pub raim_state: GpsRaimState,
13683 #[doc = "An abstract value representing the estimated quality of incoming corrections, or 255 if not available."]
13684 pub corrections_quality: u8,
13685 #[doc = "An abstract value representing the overall status of the receiver, or 255 if not available."]
13686 pub system_status_summary: u8,
13687 #[doc = "An abstract value representing the quality of incoming GNSS signals, or 255 if not available."]
13688 pub gnss_signal_quality: u8,
13689 #[doc = "An abstract value representing the estimated PPK quality, or 255 if not available."]
13690 pub post_processing_quality: u8,
13691}
13692impl GNSS_INTEGRITY_DATA {
13693 pub const ENCODED_LEN: usize = 17usize;
13694 pub const DEFAULT: Self = Self {
13695 system_errors: GpsSystemErrorFlags::DEFAULT,
13696 raim_hfom: 0_u16,
13697 raim_vfom: 0_u16,
13698 id: 0_u8,
13699 authentication_state: GpsAuthenticationState::DEFAULT,
13700 jamming_state: GpsJammingState::DEFAULT,
13701 spoofing_state: GpsSpoofingState::DEFAULT,
13702 raim_state: GpsRaimState::DEFAULT,
13703 corrections_quality: 0_u8,
13704 system_status_summary: 0_u8,
13705 gnss_signal_quality: 0_u8,
13706 post_processing_quality: 0_u8,
13707 };
13708 #[cfg(feature = "arbitrary")]
13709 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13710 use arbitrary::{Arbitrary, Unstructured};
13711 let mut buf = [0u8; 1024];
13712 rng.fill_bytes(&mut buf);
13713 let mut unstructured = Unstructured::new(&buf);
13714 Self::arbitrary(&mut unstructured).unwrap_or_default()
13715 }
13716}
13717impl Default for GNSS_INTEGRITY_DATA {
13718 fn default() -> Self {
13719 Self::DEFAULT.clone()
13720 }
13721}
13722impl MessageData for GNSS_INTEGRITY_DATA {
13723 type Message = MavMessage;
13724 const ID: u32 = 441u32;
13725 const NAME: &'static str = "GNSS_INTEGRITY";
13726 const EXTRA_CRC: u8 = 169u8;
13727 const ENCODED_LEN: usize = 17usize;
13728 fn deser(
13729 _version: MavlinkVersion,
13730 __input: &[u8],
13731 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13732 let avail_len = __input.len();
13733 let mut payload_buf = [0; Self::ENCODED_LEN];
13734 let mut buf = if avail_len < Self::ENCODED_LEN {
13735 payload_buf[0..avail_len].copy_from_slice(__input);
13736 Bytes::new(&payload_buf)
13737 } else {
13738 Bytes::new(__input)
13739 };
13740 let mut __struct = Self::default();
13741 let tmp = buf.get_u32_le();
13742 __struct.system_errors = GpsSystemErrorFlags::from_bits(
13743 tmp & GpsSystemErrorFlags::all().bits(),
13744 )
13745 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13746 flag_type: "GpsSystemErrorFlags",
13747 value: tmp as u32,
13748 })?;
13749 __struct.raim_hfom = buf.get_u16_le();
13750 __struct.raim_vfom = buf.get_u16_le();
13751 __struct.id = buf.get_u8();
13752 let tmp = buf.get_u8();
13753 __struct.authentication_state =
13754 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13755 enum_type: "GpsAuthenticationState",
13756 value: tmp as u32,
13757 })?;
13758 let tmp = buf.get_u8();
13759 __struct.jamming_state =
13760 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13761 enum_type: "GpsJammingState",
13762 value: tmp as u32,
13763 })?;
13764 let tmp = buf.get_u8();
13765 __struct.spoofing_state =
13766 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13767 enum_type: "GpsSpoofingState",
13768 value: tmp as u32,
13769 })?;
13770 let tmp = buf.get_u8();
13771 __struct.raim_state =
13772 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13773 enum_type: "GpsRaimState",
13774 value: tmp as u32,
13775 })?;
13776 __struct.corrections_quality = buf.get_u8();
13777 __struct.system_status_summary = buf.get_u8();
13778 __struct.gnss_signal_quality = buf.get_u8();
13779 __struct.post_processing_quality = buf.get_u8();
13780 Ok(__struct)
13781 }
13782 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13783 let mut __tmp = BytesMut::new(bytes);
13784 #[allow(clippy::absurd_extreme_comparisons)]
13785 #[allow(unused_comparisons)]
13786 if __tmp.remaining() < Self::ENCODED_LEN {
13787 panic!(
13788 "buffer is too small (need {} bytes, but got {})",
13789 Self::ENCODED_LEN,
13790 __tmp.remaining(),
13791 )
13792 }
13793 __tmp.put_u32_le(self.system_errors.bits());
13794 __tmp.put_u16_le(self.raim_hfom);
13795 __tmp.put_u16_le(self.raim_vfom);
13796 __tmp.put_u8(self.id);
13797 __tmp.put_u8(self.authentication_state as u8);
13798 __tmp.put_u8(self.jamming_state as u8);
13799 __tmp.put_u8(self.spoofing_state as u8);
13800 __tmp.put_u8(self.raim_state as u8);
13801 __tmp.put_u8(self.corrections_quality);
13802 __tmp.put_u8(self.system_status_summary);
13803 __tmp.put_u8(self.gnss_signal_quality);
13804 __tmp.put_u8(self.post_processing_quality);
13805 if matches!(version, MavlinkVersion::V2) {
13806 let len = __tmp.len();
13807 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13808 } else {
13809 __tmp.len()
13810 }
13811 }
13812}
13813#[doc = "id: 124"]
13814#[doc = "Second GPS data."]
13815#[derive(Debug, Clone, PartialEq)]
13816#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13817#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13818pub struct GPS2_RAW_DATA {
13819 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13820 pub time_usec: u64,
13821 #[doc = "Latitude (WGS84)"]
13822 pub lat: i32,
13823 #[doc = "Longitude (WGS84)"]
13824 pub lon: i32,
13825 #[doc = "Altitude (MSL). Positive for up."]
13826 pub alt: i32,
13827 #[doc = "Age of DGPS info"]
13828 pub dgps_age: u32,
13829 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13830 pub eph: u16,
13831 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13832 pub epv: u16,
13833 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13834 pub vel: u16,
13835 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13836 pub cog: u16,
13837 #[doc = "GPS fix type."]
13838 pub fix_type: GpsFixType,
13839 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13840 pub satellites_visible: u8,
13841 #[doc = "Number of DGPS satellites"]
13842 pub dgps_numch: u8,
13843 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13844 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13845 pub yaw: u16,
13846 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13847 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13848 pub alt_ellipsoid: i32,
13849 #[doc = "Position uncertainty."]
13850 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13851 pub h_acc: u32,
13852 #[doc = "Altitude uncertainty."]
13853 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13854 pub v_acc: u32,
13855 #[doc = "Speed uncertainty."]
13856 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13857 pub vel_acc: u32,
13858 #[doc = "Heading / track uncertainty"]
13859 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13860 pub hdg_acc: u32,
13861}
13862impl GPS2_RAW_DATA {
13863 pub const ENCODED_LEN: usize = 57usize;
13864 pub const DEFAULT: Self = Self {
13865 time_usec: 0_u64,
13866 lat: 0_i32,
13867 lon: 0_i32,
13868 alt: 0_i32,
13869 dgps_age: 0_u32,
13870 eph: 0_u16,
13871 epv: 0_u16,
13872 vel: 0_u16,
13873 cog: 0_u16,
13874 fix_type: GpsFixType::DEFAULT,
13875 satellites_visible: 0_u8,
13876 dgps_numch: 0_u8,
13877 yaw: 0_u16,
13878 alt_ellipsoid: 0_i32,
13879 h_acc: 0_u32,
13880 v_acc: 0_u32,
13881 vel_acc: 0_u32,
13882 hdg_acc: 0_u32,
13883 };
13884 #[cfg(feature = "arbitrary")]
13885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13886 use arbitrary::{Arbitrary, Unstructured};
13887 let mut buf = [0u8; 1024];
13888 rng.fill_bytes(&mut buf);
13889 let mut unstructured = Unstructured::new(&buf);
13890 Self::arbitrary(&mut unstructured).unwrap_or_default()
13891 }
13892}
13893impl Default for GPS2_RAW_DATA {
13894 fn default() -> Self {
13895 Self::DEFAULT.clone()
13896 }
13897}
13898impl MessageData for GPS2_RAW_DATA {
13899 type Message = MavMessage;
13900 const ID: u32 = 124u32;
13901 const NAME: &'static str = "GPS2_RAW";
13902 const EXTRA_CRC: u8 = 87u8;
13903 const ENCODED_LEN: usize = 57usize;
13904 fn deser(
13905 _version: MavlinkVersion,
13906 __input: &[u8],
13907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13908 let avail_len = __input.len();
13909 let mut payload_buf = [0; Self::ENCODED_LEN];
13910 let mut buf = if avail_len < Self::ENCODED_LEN {
13911 payload_buf[0..avail_len].copy_from_slice(__input);
13912 Bytes::new(&payload_buf)
13913 } else {
13914 Bytes::new(__input)
13915 };
13916 let mut __struct = Self::default();
13917 __struct.time_usec = buf.get_u64_le();
13918 __struct.lat = buf.get_i32_le();
13919 __struct.lon = buf.get_i32_le();
13920 __struct.alt = buf.get_i32_le();
13921 __struct.dgps_age = buf.get_u32_le();
13922 __struct.eph = buf.get_u16_le();
13923 __struct.epv = buf.get_u16_le();
13924 __struct.vel = buf.get_u16_le();
13925 __struct.cog = buf.get_u16_le();
13926 let tmp = buf.get_u8();
13927 __struct.fix_type =
13928 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13929 enum_type: "GpsFixType",
13930 value: tmp as u32,
13931 })?;
13932 __struct.satellites_visible = buf.get_u8();
13933 __struct.dgps_numch = buf.get_u8();
13934 __struct.yaw = buf.get_u16_le();
13935 __struct.alt_ellipsoid = buf.get_i32_le();
13936 __struct.h_acc = buf.get_u32_le();
13937 __struct.v_acc = buf.get_u32_le();
13938 __struct.vel_acc = buf.get_u32_le();
13939 __struct.hdg_acc = buf.get_u32_le();
13940 Ok(__struct)
13941 }
13942 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13943 let mut __tmp = BytesMut::new(bytes);
13944 #[allow(clippy::absurd_extreme_comparisons)]
13945 #[allow(unused_comparisons)]
13946 if __tmp.remaining() < Self::ENCODED_LEN {
13947 panic!(
13948 "buffer is too small (need {} bytes, but got {})",
13949 Self::ENCODED_LEN,
13950 __tmp.remaining(),
13951 )
13952 }
13953 __tmp.put_u64_le(self.time_usec);
13954 __tmp.put_i32_le(self.lat);
13955 __tmp.put_i32_le(self.lon);
13956 __tmp.put_i32_le(self.alt);
13957 __tmp.put_u32_le(self.dgps_age);
13958 __tmp.put_u16_le(self.eph);
13959 __tmp.put_u16_le(self.epv);
13960 __tmp.put_u16_le(self.vel);
13961 __tmp.put_u16_le(self.cog);
13962 __tmp.put_u8(self.fix_type as u8);
13963 __tmp.put_u8(self.satellites_visible);
13964 __tmp.put_u8(self.dgps_numch);
13965 __tmp.put_u16_le(self.yaw);
13966 __tmp.put_i32_le(self.alt_ellipsoid);
13967 __tmp.put_u32_le(self.h_acc);
13968 __tmp.put_u32_le(self.v_acc);
13969 __tmp.put_u32_le(self.vel_acc);
13970 __tmp.put_u32_le(self.hdg_acc);
13971 if matches!(version, MavlinkVersion::V2) {
13972 let len = __tmp.len();
13973 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13974 } else {
13975 __tmp.len()
13976 }
13977 }
13978}
13979#[doc = "id: 128"]
13980#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13981#[derive(Debug, Clone, PartialEq)]
13982#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13984pub struct GPS2_RTK_DATA {
13985 #[doc = "Time since boot of last baseline message received."]
13986 pub time_last_baseline_ms: u32,
13987 #[doc = "GPS Time of Week of last baseline"]
13988 pub tow: u32,
13989 #[doc = "Current baseline in ECEF x or NED north component."]
13990 pub baseline_a_mm: i32,
13991 #[doc = "Current baseline in ECEF y or NED east component."]
13992 pub baseline_b_mm: i32,
13993 #[doc = "Current baseline in ECEF z or NED down component."]
13994 pub baseline_c_mm: i32,
13995 #[doc = "Current estimate of baseline accuracy."]
13996 pub accuracy: u32,
13997 #[doc = "Current number of integer ambiguity hypotheses."]
13998 pub iar_num_hypotheses: i32,
13999 #[doc = "GPS Week Number of last baseline"]
14000 pub wn: u16,
14001 #[doc = "Identification of connected RTK receiver."]
14002 pub rtk_receiver_id: u8,
14003 #[doc = "GPS-specific health report for RTK data."]
14004 pub rtk_health: u8,
14005 #[doc = "Rate of baseline messages being received by GPS"]
14006 pub rtk_rate: u8,
14007 #[doc = "Current number of sats used for RTK calculation."]
14008 pub nsats: u8,
14009 #[doc = "Coordinate system of baseline"]
14010 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14011}
14012impl GPS2_RTK_DATA {
14013 pub const ENCODED_LEN: usize = 35usize;
14014 pub const DEFAULT: Self = Self {
14015 time_last_baseline_ms: 0_u32,
14016 tow: 0_u32,
14017 baseline_a_mm: 0_i32,
14018 baseline_b_mm: 0_i32,
14019 baseline_c_mm: 0_i32,
14020 accuracy: 0_u32,
14021 iar_num_hypotheses: 0_i32,
14022 wn: 0_u16,
14023 rtk_receiver_id: 0_u8,
14024 rtk_health: 0_u8,
14025 rtk_rate: 0_u8,
14026 nsats: 0_u8,
14027 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14028 };
14029 #[cfg(feature = "arbitrary")]
14030 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14031 use arbitrary::{Arbitrary, Unstructured};
14032 let mut buf = [0u8; 1024];
14033 rng.fill_bytes(&mut buf);
14034 let mut unstructured = Unstructured::new(&buf);
14035 Self::arbitrary(&mut unstructured).unwrap_or_default()
14036 }
14037}
14038impl Default for GPS2_RTK_DATA {
14039 fn default() -> Self {
14040 Self::DEFAULT.clone()
14041 }
14042}
14043impl MessageData for GPS2_RTK_DATA {
14044 type Message = MavMessage;
14045 const ID: u32 = 128u32;
14046 const NAME: &'static str = "GPS2_RTK";
14047 const EXTRA_CRC: u8 = 226u8;
14048 const ENCODED_LEN: usize = 35usize;
14049 fn deser(
14050 _version: MavlinkVersion,
14051 __input: &[u8],
14052 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14053 let avail_len = __input.len();
14054 let mut payload_buf = [0; Self::ENCODED_LEN];
14055 let mut buf = if avail_len < Self::ENCODED_LEN {
14056 payload_buf[0..avail_len].copy_from_slice(__input);
14057 Bytes::new(&payload_buf)
14058 } else {
14059 Bytes::new(__input)
14060 };
14061 let mut __struct = Self::default();
14062 __struct.time_last_baseline_ms = buf.get_u32_le();
14063 __struct.tow = buf.get_u32_le();
14064 __struct.baseline_a_mm = buf.get_i32_le();
14065 __struct.baseline_b_mm = buf.get_i32_le();
14066 __struct.baseline_c_mm = buf.get_i32_le();
14067 __struct.accuracy = buf.get_u32_le();
14068 __struct.iar_num_hypotheses = buf.get_i32_le();
14069 __struct.wn = buf.get_u16_le();
14070 __struct.rtk_receiver_id = buf.get_u8();
14071 __struct.rtk_health = buf.get_u8();
14072 __struct.rtk_rate = buf.get_u8();
14073 __struct.nsats = buf.get_u8();
14074 let tmp = buf.get_u8();
14075 __struct.baseline_coords_type =
14076 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14077 enum_type: "RtkBaselineCoordinateSystem",
14078 value: tmp as u32,
14079 })?;
14080 Ok(__struct)
14081 }
14082 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14083 let mut __tmp = BytesMut::new(bytes);
14084 #[allow(clippy::absurd_extreme_comparisons)]
14085 #[allow(unused_comparisons)]
14086 if __tmp.remaining() < Self::ENCODED_LEN {
14087 panic!(
14088 "buffer is too small (need {} bytes, but got {})",
14089 Self::ENCODED_LEN,
14090 __tmp.remaining(),
14091 )
14092 }
14093 __tmp.put_u32_le(self.time_last_baseline_ms);
14094 __tmp.put_u32_le(self.tow);
14095 __tmp.put_i32_le(self.baseline_a_mm);
14096 __tmp.put_i32_le(self.baseline_b_mm);
14097 __tmp.put_i32_le(self.baseline_c_mm);
14098 __tmp.put_u32_le(self.accuracy);
14099 __tmp.put_i32_le(self.iar_num_hypotheses);
14100 __tmp.put_u16_le(self.wn);
14101 __tmp.put_u8(self.rtk_receiver_id);
14102 __tmp.put_u8(self.rtk_health);
14103 __tmp.put_u8(self.rtk_rate);
14104 __tmp.put_u8(self.nsats);
14105 __tmp.put_u8(self.baseline_coords_type as u8);
14106 if matches!(version, MavlinkVersion::V2) {
14107 let len = __tmp.len();
14108 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14109 } else {
14110 __tmp.len()
14111 }
14112 }
14113}
14114#[doc = "id: 49"]
14115#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14116#[derive(Debug, Clone, PartialEq)]
14117#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14118#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14119pub struct GPS_GLOBAL_ORIGIN_DATA {
14120 #[doc = "Latitude (WGS84)"]
14121 pub latitude: i32,
14122 #[doc = "Longitude (WGS84)"]
14123 pub longitude: i32,
14124 #[doc = "Altitude (MSL). Positive for up."]
14125 pub altitude: i32,
14126 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14127 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14128 pub time_usec: u64,
14129}
14130impl GPS_GLOBAL_ORIGIN_DATA {
14131 pub const ENCODED_LEN: usize = 20usize;
14132 pub const DEFAULT: Self = Self {
14133 latitude: 0_i32,
14134 longitude: 0_i32,
14135 altitude: 0_i32,
14136 time_usec: 0_u64,
14137 };
14138 #[cfg(feature = "arbitrary")]
14139 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14140 use arbitrary::{Arbitrary, Unstructured};
14141 let mut buf = [0u8; 1024];
14142 rng.fill_bytes(&mut buf);
14143 let mut unstructured = Unstructured::new(&buf);
14144 Self::arbitrary(&mut unstructured).unwrap_or_default()
14145 }
14146}
14147impl Default for GPS_GLOBAL_ORIGIN_DATA {
14148 fn default() -> Self {
14149 Self::DEFAULT.clone()
14150 }
14151}
14152impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14153 type Message = MavMessage;
14154 const ID: u32 = 49u32;
14155 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14156 const EXTRA_CRC: u8 = 39u8;
14157 const ENCODED_LEN: usize = 20usize;
14158 fn deser(
14159 _version: MavlinkVersion,
14160 __input: &[u8],
14161 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14162 let avail_len = __input.len();
14163 let mut payload_buf = [0; Self::ENCODED_LEN];
14164 let mut buf = if avail_len < Self::ENCODED_LEN {
14165 payload_buf[0..avail_len].copy_from_slice(__input);
14166 Bytes::new(&payload_buf)
14167 } else {
14168 Bytes::new(__input)
14169 };
14170 let mut __struct = Self::default();
14171 __struct.latitude = buf.get_i32_le();
14172 __struct.longitude = buf.get_i32_le();
14173 __struct.altitude = buf.get_i32_le();
14174 __struct.time_usec = buf.get_u64_le();
14175 Ok(__struct)
14176 }
14177 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14178 let mut __tmp = BytesMut::new(bytes);
14179 #[allow(clippy::absurd_extreme_comparisons)]
14180 #[allow(unused_comparisons)]
14181 if __tmp.remaining() < Self::ENCODED_LEN {
14182 panic!(
14183 "buffer is too small (need {} bytes, but got {})",
14184 Self::ENCODED_LEN,
14185 __tmp.remaining(),
14186 )
14187 }
14188 __tmp.put_i32_le(self.latitude);
14189 __tmp.put_i32_le(self.longitude);
14190 __tmp.put_i32_le(self.altitude);
14191 __tmp.put_u64_le(self.time_usec);
14192 if matches!(version, MavlinkVersion::V2) {
14193 let len = __tmp.len();
14194 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14195 } else {
14196 __tmp.len()
14197 }
14198 }
14199}
14200#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14201#[doc = "id: 123"]
14202#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14203#[derive(Debug, Clone, PartialEq)]
14204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14206pub struct GPS_INJECT_DATA_DATA {
14207 #[doc = "System ID"]
14208 pub target_system: u8,
14209 #[doc = "Component ID"]
14210 pub target_component: u8,
14211 #[doc = "Data length"]
14212 pub len: u8,
14213 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14214 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14215 pub data: [u8; 110],
14216}
14217impl GPS_INJECT_DATA_DATA {
14218 pub const ENCODED_LEN: usize = 113usize;
14219 pub const DEFAULT: Self = Self {
14220 target_system: 0_u8,
14221 target_component: 0_u8,
14222 len: 0_u8,
14223 data: [0_u8; 110usize],
14224 };
14225 #[cfg(feature = "arbitrary")]
14226 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14227 use arbitrary::{Arbitrary, Unstructured};
14228 let mut buf = [0u8; 1024];
14229 rng.fill_bytes(&mut buf);
14230 let mut unstructured = Unstructured::new(&buf);
14231 Self::arbitrary(&mut unstructured).unwrap_or_default()
14232 }
14233}
14234impl Default for GPS_INJECT_DATA_DATA {
14235 fn default() -> Self {
14236 Self::DEFAULT.clone()
14237 }
14238}
14239impl MessageData for GPS_INJECT_DATA_DATA {
14240 type Message = MavMessage;
14241 const ID: u32 = 123u32;
14242 const NAME: &'static str = "GPS_INJECT_DATA";
14243 const EXTRA_CRC: u8 = 250u8;
14244 const ENCODED_LEN: usize = 113usize;
14245 fn deser(
14246 _version: MavlinkVersion,
14247 __input: &[u8],
14248 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14249 let avail_len = __input.len();
14250 let mut payload_buf = [0; Self::ENCODED_LEN];
14251 let mut buf = if avail_len < Self::ENCODED_LEN {
14252 payload_buf[0..avail_len].copy_from_slice(__input);
14253 Bytes::new(&payload_buf)
14254 } else {
14255 Bytes::new(__input)
14256 };
14257 let mut __struct = Self::default();
14258 __struct.target_system = buf.get_u8();
14259 __struct.target_component = buf.get_u8();
14260 __struct.len = buf.get_u8();
14261 for v in &mut __struct.data {
14262 let val = buf.get_u8();
14263 *v = val;
14264 }
14265 Ok(__struct)
14266 }
14267 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14268 let mut __tmp = BytesMut::new(bytes);
14269 #[allow(clippy::absurd_extreme_comparisons)]
14270 #[allow(unused_comparisons)]
14271 if __tmp.remaining() < Self::ENCODED_LEN {
14272 panic!(
14273 "buffer is too small (need {} bytes, but got {})",
14274 Self::ENCODED_LEN,
14275 __tmp.remaining(),
14276 )
14277 }
14278 __tmp.put_u8(self.target_system);
14279 __tmp.put_u8(self.target_component);
14280 __tmp.put_u8(self.len);
14281 for val in &self.data {
14282 __tmp.put_u8(*val);
14283 }
14284 if matches!(version, MavlinkVersion::V2) {
14285 let len = __tmp.len();
14286 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14287 } else {
14288 __tmp.len()
14289 }
14290 }
14291}
14292#[doc = "id: 232"]
14293#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14294#[derive(Debug, Clone, PartialEq)]
14295#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14296#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14297pub struct GPS_INPUT_DATA {
14298 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14299 pub time_usec: u64,
14300 #[doc = "GPS time (from start of GPS week)"]
14301 pub time_week_ms: u32,
14302 #[doc = "Latitude (WGS84)"]
14303 pub lat: i32,
14304 #[doc = "Longitude (WGS84)"]
14305 pub lon: i32,
14306 #[doc = "Altitude (MSL). Positive for up."]
14307 pub alt: f32,
14308 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14309 pub hdop: f32,
14310 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14311 pub vdop: f32,
14312 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14313 pub vn: f32,
14314 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14315 pub ve: f32,
14316 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14317 pub vd: f32,
14318 #[doc = "GPS speed accuracy"]
14319 pub speed_accuracy: f32,
14320 #[doc = "GPS horizontal accuracy"]
14321 pub horiz_accuracy: f32,
14322 #[doc = "GPS vertical accuracy"]
14323 pub vert_accuracy: f32,
14324 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14325 pub ignore_flags: GpsInputIgnoreFlags,
14326 #[doc = "GPS week number"]
14327 pub time_week: u16,
14328 #[doc = "ID of the GPS for multiple GPS inputs"]
14329 pub gps_id: u8,
14330 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14331 pub fix_type: u8,
14332 #[doc = "Number of satellites visible."]
14333 pub satellites_visible: u8,
14334 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14335 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14336 pub yaw: u16,
14337}
14338impl GPS_INPUT_DATA {
14339 pub const ENCODED_LEN: usize = 65usize;
14340 pub const DEFAULT: Self = Self {
14341 time_usec: 0_u64,
14342 time_week_ms: 0_u32,
14343 lat: 0_i32,
14344 lon: 0_i32,
14345 alt: 0.0_f32,
14346 hdop: 0.0_f32,
14347 vdop: 0.0_f32,
14348 vn: 0.0_f32,
14349 ve: 0.0_f32,
14350 vd: 0.0_f32,
14351 speed_accuracy: 0.0_f32,
14352 horiz_accuracy: 0.0_f32,
14353 vert_accuracy: 0.0_f32,
14354 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14355 time_week: 0_u16,
14356 gps_id: 0_u8,
14357 fix_type: 0_u8,
14358 satellites_visible: 0_u8,
14359 yaw: 0_u16,
14360 };
14361 #[cfg(feature = "arbitrary")]
14362 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14363 use arbitrary::{Arbitrary, Unstructured};
14364 let mut buf = [0u8; 1024];
14365 rng.fill_bytes(&mut buf);
14366 let mut unstructured = Unstructured::new(&buf);
14367 Self::arbitrary(&mut unstructured).unwrap_or_default()
14368 }
14369}
14370impl Default for GPS_INPUT_DATA {
14371 fn default() -> Self {
14372 Self::DEFAULT.clone()
14373 }
14374}
14375impl MessageData for GPS_INPUT_DATA {
14376 type Message = MavMessage;
14377 const ID: u32 = 232u32;
14378 const NAME: &'static str = "GPS_INPUT";
14379 const EXTRA_CRC: u8 = 151u8;
14380 const ENCODED_LEN: usize = 65usize;
14381 fn deser(
14382 _version: MavlinkVersion,
14383 __input: &[u8],
14384 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14385 let avail_len = __input.len();
14386 let mut payload_buf = [0; Self::ENCODED_LEN];
14387 let mut buf = if avail_len < Self::ENCODED_LEN {
14388 payload_buf[0..avail_len].copy_from_slice(__input);
14389 Bytes::new(&payload_buf)
14390 } else {
14391 Bytes::new(__input)
14392 };
14393 let mut __struct = Self::default();
14394 __struct.time_usec = buf.get_u64_le();
14395 __struct.time_week_ms = buf.get_u32_le();
14396 __struct.lat = buf.get_i32_le();
14397 __struct.lon = buf.get_i32_le();
14398 __struct.alt = buf.get_f32_le();
14399 __struct.hdop = buf.get_f32_le();
14400 __struct.vdop = buf.get_f32_le();
14401 __struct.vn = buf.get_f32_le();
14402 __struct.ve = buf.get_f32_le();
14403 __struct.vd = buf.get_f32_le();
14404 __struct.speed_accuracy = buf.get_f32_le();
14405 __struct.horiz_accuracy = buf.get_f32_le();
14406 __struct.vert_accuracy = buf.get_f32_le();
14407 let tmp = buf.get_u16_le();
14408 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14409 tmp & GpsInputIgnoreFlags::all().bits(),
14410 )
14411 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14412 flag_type: "GpsInputIgnoreFlags",
14413 value: tmp as u32,
14414 })?;
14415 __struct.time_week = buf.get_u16_le();
14416 __struct.gps_id = buf.get_u8();
14417 __struct.fix_type = buf.get_u8();
14418 __struct.satellites_visible = buf.get_u8();
14419 __struct.yaw = buf.get_u16_le();
14420 Ok(__struct)
14421 }
14422 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14423 let mut __tmp = BytesMut::new(bytes);
14424 #[allow(clippy::absurd_extreme_comparisons)]
14425 #[allow(unused_comparisons)]
14426 if __tmp.remaining() < Self::ENCODED_LEN {
14427 panic!(
14428 "buffer is too small (need {} bytes, but got {})",
14429 Self::ENCODED_LEN,
14430 __tmp.remaining(),
14431 )
14432 }
14433 __tmp.put_u64_le(self.time_usec);
14434 __tmp.put_u32_le(self.time_week_ms);
14435 __tmp.put_i32_le(self.lat);
14436 __tmp.put_i32_le(self.lon);
14437 __tmp.put_f32_le(self.alt);
14438 __tmp.put_f32_le(self.hdop);
14439 __tmp.put_f32_le(self.vdop);
14440 __tmp.put_f32_le(self.vn);
14441 __tmp.put_f32_le(self.ve);
14442 __tmp.put_f32_le(self.vd);
14443 __tmp.put_f32_le(self.speed_accuracy);
14444 __tmp.put_f32_le(self.horiz_accuracy);
14445 __tmp.put_f32_le(self.vert_accuracy);
14446 __tmp.put_u16_le(self.ignore_flags.bits());
14447 __tmp.put_u16_le(self.time_week);
14448 __tmp.put_u8(self.gps_id);
14449 __tmp.put_u8(self.fix_type);
14450 __tmp.put_u8(self.satellites_visible);
14451 __tmp.put_u16_le(self.yaw);
14452 if matches!(version, MavlinkVersion::V2) {
14453 let len = __tmp.len();
14454 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14455 } else {
14456 __tmp.len()
14457 }
14458 }
14459}
14460#[doc = "id: 24"]
14461#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14462#[derive(Debug, Clone, PartialEq)]
14463#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14464#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14465pub struct GPS_RAW_INT_DATA {
14466 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14467 pub time_usec: u64,
14468 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14469 pub lat: i32,
14470 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14471 pub lon: i32,
14472 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14473 pub alt: i32,
14474 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14475 pub eph: u16,
14476 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14477 pub epv: u16,
14478 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14479 pub vel: u16,
14480 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14481 pub cog: u16,
14482 #[doc = "GPS fix type."]
14483 pub fix_type: GpsFixType,
14484 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14485 pub satellites_visible: u8,
14486 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14487 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14488 pub alt_ellipsoid: i32,
14489 #[doc = "Position uncertainty."]
14490 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14491 pub h_acc: u32,
14492 #[doc = "Altitude uncertainty."]
14493 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14494 pub v_acc: u32,
14495 #[doc = "Speed uncertainty."]
14496 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14497 pub vel_acc: u32,
14498 #[doc = "Heading / track uncertainty"]
14499 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14500 pub hdg_acc: u32,
14501 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14502 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14503 pub yaw: u16,
14504}
14505impl GPS_RAW_INT_DATA {
14506 pub const ENCODED_LEN: usize = 52usize;
14507 pub const DEFAULT: Self = Self {
14508 time_usec: 0_u64,
14509 lat: 0_i32,
14510 lon: 0_i32,
14511 alt: 0_i32,
14512 eph: 0_u16,
14513 epv: 0_u16,
14514 vel: 0_u16,
14515 cog: 0_u16,
14516 fix_type: GpsFixType::DEFAULT,
14517 satellites_visible: 0_u8,
14518 alt_ellipsoid: 0_i32,
14519 h_acc: 0_u32,
14520 v_acc: 0_u32,
14521 vel_acc: 0_u32,
14522 hdg_acc: 0_u32,
14523 yaw: 0_u16,
14524 };
14525 #[cfg(feature = "arbitrary")]
14526 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14527 use arbitrary::{Arbitrary, Unstructured};
14528 let mut buf = [0u8; 1024];
14529 rng.fill_bytes(&mut buf);
14530 let mut unstructured = Unstructured::new(&buf);
14531 Self::arbitrary(&mut unstructured).unwrap_or_default()
14532 }
14533}
14534impl Default for GPS_RAW_INT_DATA {
14535 fn default() -> Self {
14536 Self::DEFAULT.clone()
14537 }
14538}
14539impl MessageData for GPS_RAW_INT_DATA {
14540 type Message = MavMessage;
14541 const ID: u32 = 24u32;
14542 const NAME: &'static str = "GPS_RAW_INT";
14543 const EXTRA_CRC: u8 = 24u8;
14544 const ENCODED_LEN: usize = 52usize;
14545 fn deser(
14546 _version: MavlinkVersion,
14547 __input: &[u8],
14548 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14549 let avail_len = __input.len();
14550 let mut payload_buf = [0; Self::ENCODED_LEN];
14551 let mut buf = if avail_len < Self::ENCODED_LEN {
14552 payload_buf[0..avail_len].copy_from_slice(__input);
14553 Bytes::new(&payload_buf)
14554 } else {
14555 Bytes::new(__input)
14556 };
14557 let mut __struct = Self::default();
14558 __struct.time_usec = buf.get_u64_le();
14559 __struct.lat = buf.get_i32_le();
14560 __struct.lon = buf.get_i32_le();
14561 __struct.alt = buf.get_i32_le();
14562 __struct.eph = buf.get_u16_le();
14563 __struct.epv = buf.get_u16_le();
14564 __struct.vel = buf.get_u16_le();
14565 __struct.cog = buf.get_u16_le();
14566 let tmp = buf.get_u8();
14567 __struct.fix_type =
14568 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14569 enum_type: "GpsFixType",
14570 value: tmp as u32,
14571 })?;
14572 __struct.satellites_visible = buf.get_u8();
14573 __struct.alt_ellipsoid = buf.get_i32_le();
14574 __struct.h_acc = buf.get_u32_le();
14575 __struct.v_acc = buf.get_u32_le();
14576 __struct.vel_acc = buf.get_u32_le();
14577 __struct.hdg_acc = buf.get_u32_le();
14578 __struct.yaw = buf.get_u16_le();
14579 Ok(__struct)
14580 }
14581 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14582 let mut __tmp = BytesMut::new(bytes);
14583 #[allow(clippy::absurd_extreme_comparisons)]
14584 #[allow(unused_comparisons)]
14585 if __tmp.remaining() < Self::ENCODED_LEN {
14586 panic!(
14587 "buffer is too small (need {} bytes, but got {})",
14588 Self::ENCODED_LEN,
14589 __tmp.remaining(),
14590 )
14591 }
14592 __tmp.put_u64_le(self.time_usec);
14593 __tmp.put_i32_le(self.lat);
14594 __tmp.put_i32_le(self.lon);
14595 __tmp.put_i32_le(self.alt);
14596 __tmp.put_u16_le(self.eph);
14597 __tmp.put_u16_le(self.epv);
14598 __tmp.put_u16_le(self.vel);
14599 __tmp.put_u16_le(self.cog);
14600 __tmp.put_u8(self.fix_type as u8);
14601 __tmp.put_u8(self.satellites_visible);
14602 __tmp.put_i32_le(self.alt_ellipsoid);
14603 __tmp.put_u32_le(self.h_acc);
14604 __tmp.put_u32_le(self.v_acc);
14605 __tmp.put_u32_le(self.vel_acc);
14606 __tmp.put_u32_le(self.hdg_acc);
14607 __tmp.put_u16_le(self.yaw);
14608 if matches!(version, MavlinkVersion::V2) {
14609 let len = __tmp.len();
14610 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14611 } else {
14612 __tmp.len()
14613 }
14614 }
14615}
14616#[doc = "id: 233"]
14617#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14618#[derive(Debug, Clone, PartialEq)]
14619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14621pub struct GPS_RTCM_DATA_DATA {
14622 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14623 pub flags: u8,
14624 #[doc = "data length"]
14625 pub len: u8,
14626 #[doc = "RTCM message (may be fragmented)"]
14627 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14628 pub data: [u8; 180],
14629}
14630impl GPS_RTCM_DATA_DATA {
14631 pub const ENCODED_LEN: usize = 182usize;
14632 pub const DEFAULT: Self = Self {
14633 flags: 0_u8,
14634 len: 0_u8,
14635 data: [0_u8; 180usize],
14636 };
14637 #[cfg(feature = "arbitrary")]
14638 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14639 use arbitrary::{Arbitrary, Unstructured};
14640 let mut buf = [0u8; 1024];
14641 rng.fill_bytes(&mut buf);
14642 let mut unstructured = Unstructured::new(&buf);
14643 Self::arbitrary(&mut unstructured).unwrap_or_default()
14644 }
14645}
14646impl Default for GPS_RTCM_DATA_DATA {
14647 fn default() -> Self {
14648 Self::DEFAULT.clone()
14649 }
14650}
14651impl MessageData for GPS_RTCM_DATA_DATA {
14652 type Message = MavMessage;
14653 const ID: u32 = 233u32;
14654 const NAME: &'static str = "GPS_RTCM_DATA";
14655 const EXTRA_CRC: u8 = 35u8;
14656 const ENCODED_LEN: usize = 182usize;
14657 fn deser(
14658 _version: MavlinkVersion,
14659 __input: &[u8],
14660 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14661 let avail_len = __input.len();
14662 let mut payload_buf = [0; Self::ENCODED_LEN];
14663 let mut buf = if avail_len < Self::ENCODED_LEN {
14664 payload_buf[0..avail_len].copy_from_slice(__input);
14665 Bytes::new(&payload_buf)
14666 } else {
14667 Bytes::new(__input)
14668 };
14669 let mut __struct = Self::default();
14670 __struct.flags = buf.get_u8();
14671 __struct.len = buf.get_u8();
14672 for v in &mut __struct.data {
14673 let val = buf.get_u8();
14674 *v = val;
14675 }
14676 Ok(__struct)
14677 }
14678 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14679 let mut __tmp = BytesMut::new(bytes);
14680 #[allow(clippy::absurd_extreme_comparisons)]
14681 #[allow(unused_comparisons)]
14682 if __tmp.remaining() < Self::ENCODED_LEN {
14683 panic!(
14684 "buffer is too small (need {} bytes, but got {})",
14685 Self::ENCODED_LEN,
14686 __tmp.remaining(),
14687 )
14688 }
14689 __tmp.put_u8(self.flags);
14690 __tmp.put_u8(self.len);
14691 for val in &self.data {
14692 __tmp.put_u8(*val);
14693 }
14694 if matches!(version, MavlinkVersion::V2) {
14695 let len = __tmp.len();
14696 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14697 } else {
14698 __tmp.len()
14699 }
14700 }
14701}
14702#[doc = "id: 127"]
14703#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14704#[derive(Debug, Clone, PartialEq)]
14705#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14706#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14707pub struct GPS_RTK_DATA {
14708 #[doc = "Time since boot of last baseline message received."]
14709 pub time_last_baseline_ms: u32,
14710 #[doc = "GPS Time of Week of last baseline"]
14711 pub tow: u32,
14712 #[doc = "Current baseline in ECEF x or NED north component."]
14713 pub baseline_a_mm: i32,
14714 #[doc = "Current baseline in ECEF y or NED east component."]
14715 pub baseline_b_mm: i32,
14716 #[doc = "Current baseline in ECEF z or NED down component."]
14717 pub baseline_c_mm: i32,
14718 #[doc = "Current estimate of baseline accuracy."]
14719 pub accuracy: u32,
14720 #[doc = "Current number of integer ambiguity hypotheses."]
14721 pub iar_num_hypotheses: i32,
14722 #[doc = "GPS Week Number of last baseline"]
14723 pub wn: u16,
14724 #[doc = "Identification of connected RTK receiver."]
14725 pub rtk_receiver_id: u8,
14726 #[doc = "GPS-specific health report for RTK data."]
14727 pub rtk_health: u8,
14728 #[doc = "Rate of baseline messages being received by GPS"]
14729 pub rtk_rate: u8,
14730 #[doc = "Current number of sats used for RTK calculation."]
14731 pub nsats: u8,
14732 #[doc = "Coordinate system of baseline"]
14733 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14734}
14735impl GPS_RTK_DATA {
14736 pub const ENCODED_LEN: usize = 35usize;
14737 pub const DEFAULT: Self = Self {
14738 time_last_baseline_ms: 0_u32,
14739 tow: 0_u32,
14740 baseline_a_mm: 0_i32,
14741 baseline_b_mm: 0_i32,
14742 baseline_c_mm: 0_i32,
14743 accuracy: 0_u32,
14744 iar_num_hypotheses: 0_i32,
14745 wn: 0_u16,
14746 rtk_receiver_id: 0_u8,
14747 rtk_health: 0_u8,
14748 rtk_rate: 0_u8,
14749 nsats: 0_u8,
14750 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14751 };
14752 #[cfg(feature = "arbitrary")]
14753 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14754 use arbitrary::{Arbitrary, Unstructured};
14755 let mut buf = [0u8; 1024];
14756 rng.fill_bytes(&mut buf);
14757 let mut unstructured = Unstructured::new(&buf);
14758 Self::arbitrary(&mut unstructured).unwrap_or_default()
14759 }
14760}
14761impl Default for GPS_RTK_DATA {
14762 fn default() -> Self {
14763 Self::DEFAULT.clone()
14764 }
14765}
14766impl MessageData for GPS_RTK_DATA {
14767 type Message = MavMessage;
14768 const ID: u32 = 127u32;
14769 const NAME: &'static str = "GPS_RTK";
14770 const EXTRA_CRC: u8 = 25u8;
14771 const ENCODED_LEN: usize = 35usize;
14772 fn deser(
14773 _version: MavlinkVersion,
14774 __input: &[u8],
14775 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14776 let avail_len = __input.len();
14777 let mut payload_buf = [0; Self::ENCODED_LEN];
14778 let mut buf = if avail_len < Self::ENCODED_LEN {
14779 payload_buf[0..avail_len].copy_from_slice(__input);
14780 Bytes::new(&payload_buf)
14781 } else {
14782 Bytes::new(__input)
14783 };
14784 let mut __struct = Self::default();
14785 __struct.time_last_baseline_ms = buf.get_u32_le();
14786 __struct.tow = buf.get_u32_le();
14787 __struct.baseline_a_mm = buf.get_i32_le();
14788 __struct.baseline_b_mm = buf.get_i32_le();
14789 __struct.baseline_c_mm = buf.get_i32_le();
14790 __struct.accuracy = buf.get_u32_le();
14791 __struct.iar_num_hypotheses = buf.get_i32_le();
14792 __struct.wn = buf.get_u16_le();
14793 __struct.rtk_receiver_id = buf.get_u8();
14794 __struct.rtk_health = buf.get_u8();
14795 __struct.rtk_rate = buf.get_u8();
14796 __struct.nsats = buf.get_u8();
14797 let tmp = buf.get_u8();
14798 __struct.baseline_coords_type =
14799 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14800 enum_type: "RtkBaselineCoordinateSystem",
14801 value: tmp as u32,
14802 })?;
14803 Ok(__struct)
14804 }
14805 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14806 let mut __tmp = BytesMut::new(bytes);
14807 #[allow(clippy::absurd_extreme_comparisons)]
14808 #[allow(unused_comparisons)]
14809 if __tmp.remaining() < Self::ENCODED_LEN {
14810 panic!(
14811 "buffer is too small (need {} bytes, but got {})",
14812 Self::ENCODED_LEN,
14813 __tmp.remaining(),
14814 )
14815 }
14816 __tmp.put_u32_le(self.time_last_baseline_ms);
14817 __tmp.put_u32_le(self.tow);
14818 __tmp.put_i32_le(self.baseline_a_mm);
14819 __tmp.put_i32_le(self.baseline_b_mm);
14820 __tmp.put_i32_le(self.baseline_c_mm);
14821 __tmp.put_u32_le(self.accuracy);
14822 __tmp.put_i32_le(self.iar_num_hypotheses);
14823 __tmp.put_u16_le(self.wn);
14824 __tmp.put_u8(self.rtk_receiver_id);
14825 __tmp.put_u8(self.rtk_health);
14826 __tmp.put_u8(self.rtk_rate);
14827 __tmp.put_u8(self.nsats);
14828 __tmp.put_u8(self.baseline_coords_type as u8);
14829 if matches!(version, MavlinkVersion::V2) {
14830 let len = __tmp.len();
14831 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14832 } else {
14833 __tmp.len()
14834 }
14835 }
14836}
14837#[doc = "id: 25"]
14838#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14839#[derive(Debug, Clone, PartialEq)]
14840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14842pub struct GPS_STATUS_DATA {
14843 #[doc = "Number of satellites visible"]
14844 pub satellites_visible: u8,
14845 #[doc = "Global satellite ID"]
14846 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14847 pub satellite_prn: [u8; 20],
14848 #[doc = "0: Satellite not used, 1: used for localization"]
14849 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14850 pub satellite_used: [u8; 20],
14851 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14852 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14853 pub satellite_elevation: [u8; 20],
14854 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14855 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14856 pub satellite_azimuth: [u8; 20],
14857 #[doc = "Signal to noise ratio of satellite"]
14858 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14859 pub satellite_snr: [u8; 20],
14860}
14861impl GPS_STATUS_DATA {
14862 pub const ENCODED_LEN: usize = 101usize;
14863 pub const DEFAULT: Self = Self {
14864 satellites_visible: 0_u8,
14865 satellite_prn: [0_u8; 20usize],
14866 satellite_used: [0_u8; 20usize],
14867 satellite_elevation: [0_u8; 20usize],
14868 satellite_azimuth: [0_u8; 20usize],
14869 satellite_snr: [0_u8; 20usize],
14870 };
14871 #[cfg(feature = "arbitrary")]
14872 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14873 use arbitrary::{Arbitrary, Unstructured};
14874 let mut buf = [0u8; 1024];
14875 rng.fill_bytes(&mut buf);
14876 let mut unstructured = Unstructured::new(&buf);
14877 Self::arbitrary(&mut unstructured).unwrap_or_default()
14878 }
14879}
14880impl Default for GPS_STATUS_DATA {
14881 fn default() -> Self {
14882 Self::DEFAULT.clone()
14883 }
14884}
14885impl MessageData for GPS_STATUS_DATA {
14886 type Message = MavMessage;
14887 const ID: u32 = 25u32;
14888 const NAME: &'static str = "GPS_STATUS";
14889 const EXTRA_CRC: u8 = 23u8;
14890 const ENCODED_LEN: usize = 101usize;
14891 fn deser(
14892 _version: MavlinkVersion,
14893 __input: &[u8],
14894 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14895 let avail_len = __input.len();
14896 let mut payload_buf = [0; Self::ENCODED_LEN];
14897 let mut buf = if avail_len < Self::ENCODED_LEN {
14898 payload_buf[0..avail_len].copy_from_slice(__input);
14899 Bytes::new(&payload_buf)
14900 } else {
14901 Bytes::new(__input)
14902 };
14903 let mut __struct = Self::default();
14904 __struct.satellites_visible = buf.get_u8();
14905 for v in &mut __struct.satellite_prn {
14906 let val = buf.get_u8();
14907 *v = val;
14908 }
14909 for v in &mut __struct.satellite_used {
14910 let val = buf.get_u8();
14911 *v = val;
14912 }
14913 for v in &mut __struct.satellite_elevation {
14914 let val = buf.get_u8();
14915 *v = val;
14916 }
14917 for v in &mut __struct.satellite_azimuth {
14918 let val = buf.get_u8();
14919 *v = val;
14920 }
14921 for v in &mut __struct.satellite_snr {
14922 let val = buf.get_u8();
14923 *v = val;
14924 }
14925 Ok(__struct)
14926 }
14927 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14928 let mut __tmp = BytesMut::new(bytes);
14929 #[allow(clippy::absurd_extreme_comparisons)]
14930 #[allow(unused_comparisons)]
14931 if __tmp.remaining() < Self::ENCODED_LEN {
14932 panic!(
14933 "buffer is too small (need {} bytes, but got {})",
14934 Self::ENCODED_LEN,
14935 __tmp.remaining(),
14936 )
14937 }
14938 __tmp.put_u8(self.satellites_visible);
14939 for val in &self.satellite_prn {
14940 __tmp.put_u8(*val);
14941 }
14942 for val in &self.satellite_used {
14943 __tmp.put_u8(*val);
14944 }
14945 for val in &self.satellite_elevation {
14946 __tmp.put_u8(*val);
14947 }
14948 for val in &self.satellite_azimuth {
14949 __tmp.put_u8(*val);
14950 }
14951 for val in &self.satellite_snr {
14952 __tmp.put_u8(*val);
14953 }
14954 if matches!(version, MavlinkVersion::V2) {
14955 let len = __tmp.len();
14956 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14957 } else {
14958 __tmp.len()
14959 }
14960 }
14961}
14962#[doc = "id: 415"]
14963#[doc = "Emitted during mission execution when control reaches MAV_CMD_GROUP_END."]
14964#[derive(Debug, Clone, PartialEq)]
14965#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14966#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14967pub struct GROUP_END_DATA {
14968 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14969 pub time_usec: u64,
14970 #[doc = "Mission-unique group id (from MAV_CMD_GROUP_END)."]
14971 pub group_id: u32,
14972 #[doc = "CRC32 checksum of current plan for MAV_MISSION_TYPE_ALL. As defined in MISSION_CHECKSUM message."]
14973 pub mission_checksum: u32,
14974}
14975impl GROUP_END_DATA {
14976 pub const ENCODED_LEN: usize = 16usize;
14977 pub const DEFAULT: Self = Self {
14978 time_usec: 0_u64,
14979 group_id: 0_u32,
14980 mission_checksum: 0_u32,
14981 };
14982 #[cfg(feature = "arbitrary")]
14983 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14984 use arbitrary::{Arbitrary, Unstructured};
14985 let mut buf = [0u8; 1024];
14986 rng.fill_bytes(&mut buf);
14987 let mut unstructured = Unstructured::new(&buf);
14988 Self::arbitrary(&mut unstructured).unwrap_or_default()
14989 }
14990}
14991impl Default for GROUP_END_DATA {
14992 fn default() -> Self {
14993 Self::DEFAULT.clone()
14994 }
14995}
14996impl MessageData for GROUP_END_DATA {
14997 type Message = MavMessage;
14998 const ID: u32 = 415u32;
14999 const NAME: &'static str = "GROUP_END";
15000 const EXTRA_CRC: u8 = 161u8;
15001 const ENCODED_LEN: usize = 16usize;
15002 fn deser(
15003 _version: MavlinkVersion,
15004 __input: &[u8],
15005 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15006 let avail_len = __input.len();
15007 let mut payload_buf = [0; Self::ENCODED_LEN];
15008 let mut buf = if avail_len < Self::ENCODED_LEN {
15009 payload_buf[0..avail_len].copy_from_slice(__input);
15010 Bytes::new(&payload_buf)
15011 } else {
15012 Bytes::new(__input)
15013 };
15014 let mut __struct = Self::default();
15015 __struct.time_usec = buf.get_u64_le();
15016 __struct.group_id = buf.get_u32_le();
15017 __struct.mission_checksum = buf.get_u32_le();
15018 Ok(__struct)
15019 }
15020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15021 let mut __tmp = BytesMut::new(bytes);
15022 #[allow(clippy::absurd_extreme_comparisons)]
15023 #[allow(unused_comparisons)]
15024 if __tmp.remaining() < Self::ENCODED_LEN {
15025 panic!(
15026 "buffer is too small (need {} bytes, but got {})",
15027 Self::ENCODED_LEN,
15028 __tmp.remaining(),
15029 )
15030 }
15031 __tmp.put_u64_le(self.time_usec);
15032 __tmp.put_u32_le(self.group_id);
15033 __tmp.put_u32_le(self.mission_checksum);
15034 if matches!(version, MavlinkVersion::V2) {
15035 let len = __tmp.len();
15036 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15037 } else {
15038 __tmp.len()
15039 }
15040 }
15041}
15042#[doc = "id: 414"]
15043#[doc = "Emitted during mission execution when control reaches MAV_CMD_GROUP_START."]
15044#[derive(Debug, Clone, PartialEq)]
15045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15047pub struct GROUP_START_DATA {
15048 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15049 pub time_usec: u64,
15050 #[doc = "Mission-unique group id (from MAV_CMD_GROUP_START)."]
15051 pub group_id: u32,
15052 #[doc = "CRC32 checksum of current plan for MAV_MISSION_TYPE_ALL. As defined in MISSION_CHECKSUM message."]
15053 pub mission_checksum: u32,
15054}
15055impl GROUP_START_DATA {
15056 pub const ENCODED_LEN: usize = 16usize;
15057 pub const DEFAULT: Self = Self {
15058 time_usec: 0_u64,
15059 group_id: 0_u32,
15060 mission_checksum: 0_u32,
15061 };
15062 #[cfg(feature = "arbitrary")]
15063 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15064 use arbitrary::{Arbitrary, Unstructured};
15065 let mut buf = [0u8; 1024];
15066 rng.fill_bytes(&mut buf);
15067 let mut unstructured = Unstructured::new(&buf);
15068 Self::arbitrary(&mut unstructured).unwrap_or_default()
15069 }
15070}
15071impl Default for GROUP_START_DATA {
15072 fn default() -> Self {
15073 Self::DEFAULT.clone()
15074 }
15075}
15076impl MessageData for GROUP_START_DATA {
15077 type Message = MavMessage;
15078 const ID: u32 = 414u32;
15079 const NAME: &'static str = "GROUP_START";
15080 const EXTRA_CRC: u8 = 109u8;
15081 const ENCODED_LEN: usize = 16usize;
15082 fn deser(
15083 _version: MavlinkVersion,
15084 __input: &[u8],
15085 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15086 let avail_len = __input.len();
15087 let mut payload_buf = [0; Self::ENCODED_LEN];
15088 let mut buf = if avail_len < Self::ENCODED_LEN {
15089 payload_buf[0..avail_len].copy_from_slice(__input);
15090 Bytes::new(&payload_buf)
15091 } else {
15092 Bytes::new(__input)
15093 };
15094 let mut __struct = Self::default();
15095 __struct.time_usec = buf.get_u64_le();
15096 __struct.group_id = buf.get_u32_le();
15097 __struct.mission_checksum = buf.get_u32_le();
15098 Ok(__struct)
15099 }
15100 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15101 let mut __tmp = BytesMut::new(bytes);
15102 #[allow(clippy::absurd_extreme_comparisons)]
15103 #[allow(unused_comparisons)]
15104 if __tmp.remaining() < Self::ENCODED_LEN {
15105 panic!(
15106 "buffer is too small (need {} bytes, but got {})",
15107 Self::ENCODED_LEN,
15108 __tmp.remaining(),
15109 )
15110 }
15111 __tmp.put_u64_le(self.time_usec);
15112 __tmp.put_u32_le(self.group_id);
15113 __tmp.put_u32_le(self.mission_checksum);
15114 if matches!(version, MavlinkVersion::V2) {
15115 let len = __tmp.len();
15116 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15117 } else {
15118 __tmp.len()
15119 }
15120 }
15121}
15122#[doc = "id: 0"]
15123#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15124#[derive(Debug, Clone, PartialEq)]
15125#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15126#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15127pub struct HEARTBEAT_DATA {
15128 #[doc = "A bitfield for use for autopilot-specific flags"]
15129 pub custom_mode: u32,
15130 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15131 pub mavtype: MavType,
15132 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15133 pub autopilot: MavAutopilot,
15134 #[doc = "System mode bitmap."]
15135 pub base_mode: MavModeFlag,
15136 #[doc = "System status flag."]
15137 pub system_status: MavState,
15138 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15139 pub mavlink_version: u8,
15140}
15141impl HEARTBEAT_DATA {
15142 pub const ENCODED_LEN: usize = 9usize;
15143 pub const DEFAULT: Self = Self {
15144 custom_mode: 0_u32,
15145 mavtype: MavType::DEFAULT,
15146 autopilot: MavAutopilot::DEFAULT,
15147 base_mode: MavModeFlag::DEFAULT,
15148 system_status: MavState::DEFAULT,
15149 mavlink_version: 0_u8,
15150 };
15151 #[cfg(feature = "arbitrary")]
15152 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15153 use arbitrary::{Arbitrary, Unstructured};
15154 let mut buf = [0u8; 1024];
15155 rng.fill_bytes(&mut buf);
15156 let mut unstructured = Unstructured::new(&buf);
15157 Self::arbitrary(&mut unstructured).unwrap_or_default()
15158 }
15159}
15160impl Default for HEARTBEAT_DATA {
15161 fn default() -> Self {
15162 Self::DEFAULT.clone()
15163 }
15164}
15165impl MessageData for HEARTBEAT_DATA {
15166 type Message = MavMessage;
15167 const ID: u32 = 0u32;
15168 const NAME: &'static str = "HEARTBEAT";
15169 const EXTRA_CRC: u8 = 50u8;
15170 const ENCODED_LEN: usize = 9usize;
15171 fn deser(
15172 _version: MavlinkVersion,
15173 __input: &[u8],
15174 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15175 let avail_len = __input.len();
15176 let mut payload_buf = [0; Self::ENCODED_LEN];
15177 let mut buf = if avail_len < Self::ENCODED_LEN {
15178 payload_buf[0..avail_len].copy_from_slice(__input);
15179 Bytes::new(&payload_buf)
15180 } else {
15181 Bytes::new(__input)
15182 };
15183 let mut __struct = Self::default();
15184 __struct.custom_mode = buf.get_u32_le();
15185 let tmp = buf.get_u8();
15186 __struct.mavtype =
15187 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15188 enum_type: "MavType",
15189 value: tmp as u32,
15190 })?;
15191 let tmp = buf.get_u8();
15192 __struct.autopilot =
15193 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15194 enum_type: "MavAutopilot",
15195 value: tmp as u32,
15196 })?;
15197 let tmp = buf.get_u8();
15198 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15199 ::mavlink_core::error::ParserError::InvalidFlag {
15200 flag_type: "MavModeFlag",
15201 value: tmp as u32,
15202 },
15203 )?;
15204 let tmp = buf.get_u8();
15205 __struct.system_status =
15206 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15207 enum_type: "MavState",
15208 value: tmp as u32,
15209 })?;
15210 __struct.mavlink_version = buf.get_u8();
15211 Ok(__struct)
15212 }
15213 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15214 let mut __tmp = BytesMut::new(bytes);
15215 #[allow(clippy::absurd_extreme_comparisons)]
15216 #[allow(unused_comparisons)]
15217 if __tmp.remaining() < Self::ENCODED_LEN {
15218 panic!(
15219 "buffer is too small (need {} bytes, but got {})",
15220 Self::ENCODED_LEN,
15221 __tmp.remaining(),
15222 )
15223 }
15224 __tmp.put_u32_le(self.custom_mode);
15225 __tmp.put_u8(self.mavtype as u8);
15226 __tmp.put_u8(self.autopilot as u8);
15227 __tmp.put_u8(self.base_mode.bits());
15228 __tmp.put_u8(self.system_status as u8);
15229 __tmp.put_u8(self.mavlink_version);
15230 if matches!(version, MavlinkVersion::V2) {
15231 let len = __tmp.len();
15232 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15233 } else {
15234 __tmp.len()
15235 }
15236 }
15237}
15238#[doc = "id: 105"]
15239#[doc = "The IMU readings in SI units in NED body frame."]
15240#[derive(Debug, Clone, PartialEq)]
15241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15243pub struct HIGHRES_IMU_DATA {
15244 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15245 pub time_usec: u64,
15246 #[doc = "X acceleration"]
15247 pub xacc: f32,
15248 #[doc = "Y acceleration"]
15249 pub yacc: f32,
15250 #[doc = "Z acceleration"]
15251 pub zacc: f32,
15252 #[doc = "Angular speed around X axis"]
15253 pub xgyro: f32,
15254 #[doc = "Angular speed around Y axis"]
15255 pub ygyro: f32,
15256 #[doc = "Angular speed around Z axis"]
15257 pub zgyro: f32,
15258 #[doc = "X Magnetic field"]
15259 pub xmag: f32,
15260 #[doc = "Y Magnetic field"]
15261 pub ymag: f32,
15262 #[doc = "Z Magnetic field"]
15263 pub zmag: f32,
15264 #[doc = "Absolute pressure"]
15265 pub abs_pressure: f32,
15266 #[doc = "Differential pressure"]
15267 pub diff_pressure: f32,
15268 #[doc = "Altitude calculated from pressure"]
15269 pub pressure_alt: f32,
15270 #[doc = "Temperature"]
15271 pub temperature: f32,
15272 #[doc = "Bitmap for fields that have updated since last message"]
15273 pub fields_updated: HighresImuUpdatedFlags,
15274 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15275 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15276 pub id: u8,
15277}
15278impl HIGHRES_IMU_DATA {
15279 pub const ENCODED_LEN: usize = 63usize;
15280 pub const DEFAULT: Self = Self {
15281 time_usec: 0_u64,
15282 xacc: 0.0_f32,
15283 yacc: 0.0_f32,
15284 zacc: 0.0_f32,
15285 xgyro: 0.0_f32,
15286 ygyro: 0.0_f32,
15287 zgyro: 0.0_f32,
15288 xmag: 0.0_f32,
15289 ymag: 0.0_f32,
15290 zmag: 0.0_f32,
15291 abs_pressure: 0.0_f32,
15292 diff_pressure: 0.0_f32,
15293 pressure_alt: 0.0_f32,
15294 temperature: 0.0_f32,
15295 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15296 id: 0_u8,
15297 };
15298 #[cfg(feature = "arbitrary")]
15299 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15300 use arbitrary::{Arbitrary, Unstructured};
15301 let mut buf = [0u8; 1024];
15302 rng.fill_bytes(&mut buf);
15303 let mut unstructured = Unstructured::new(&buf);
15304 Self::arbitrary(&mut unstructured).unwrap_or_default()
15305 }
15306}
15307impl Default for HIGHRES_IMU_DATA {
15308 fn default() -> Self {
15309 Self::DEFAULT.clone()
15310 }
15311}
15312impl MessageData for HIGHRES_IMU_DATA {
15313 type Message = MavMessage;
15314 const ID: u32 = 105u32;
15315 const NAME: &'static str = "HIGHRES_IMU";
15316 const EXTRA_CRC: u8 = 93u8;
15317 const ENCODED_LEN: usize = 63usize;
15318 fn deser(
15319 _version: MavlinkVersion,
15320 __input: &[u8],
15321 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15322 let avail_len = __input.len();
15323 let mut payload_buf = [0; Self::ENCODED_LEN];
15324 let mut buf = if avail_len < Self::ENCODED_LEN {
15325 payload_buf[0..avail_len].copy_from_slice(__input);
15326 Bytes::new(&payload_buf)
15327 } else {
15328 Bytes::new(__input)
15329 };
15330 let mut __struct = Self::default();
15331 __struct.time_usec = buf.get_u64_le();
15332 __struct.xacc = buf.get_f32_le();
15333 __struct.yacc = buf.get_f32_le();
15334 __struct.zacc = buf.get_f32_le();
15335 __struct.xgyro = buf.get_f32_le();
15336 __struct.ygyro = buf.get_f32_le();
15337 __struct.zgyro = buf.get_f32_le();
15338 __struct.xmag = buf.get_f32_le();
15339 __struct.ymag = buf.get_f32_le();
15340 __struct.zmag = buf.get_f32_le();
15341 __struct.abs_pressure = buf.get_f32_le();
15342 __struct.diff_pressure = buf.get_f32_le();
15343 __struct.pressure_alt = buf.get_f32_le();
15344 __struct.temperature = buf.get_f32_le();
15345 let tmp = buf.get_u16_le();
15346 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
15347 tmp & HighresImuUpdatedFlags::all().bits(),
15348 )
15349 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15350 flag_type: "HighresImuUpdatedFlags",
15351 value: tmp as u32,
15352 })?;
15353 __struct.id = buf.get_u8();
15354 Ok(__struct)
15355 }
15356 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15357 let mut __tmp = BytesMut::new(bytes);
15358 #[allow(clippy::absurd_extreme_comparisons)]
15359 #[allow(unused_comparisons)]
15360 if __tmp.remaining() < Self::ENCODED_LEN {
15361 panic!(
15362 "buffer is too small (need {} bytes, but got {})",
15363 Self::ENCODED_LEN,
15364 __tmp.remaining(),
15365 )
15366 }
15367 __tmp.put_u64_le(self.time_usec);
15368 __tmp.put_f32_le(self.xacc);
15369 __tmp.put_f32_le(self.yacc);
15370 __tmp.put_f32_le(self.zacc);
15371 __tmp.put_f32_le(self.xgyro);
15372 __tmp.put_f32_le(self.ygyro);
15373 __tmp.put_f32_le(self.zgyro);
15374 __tmp.put_f32_le(self.xmag);
15375 __tmp.put_f32_le(self.ymag);
15376 __tmp.put_f32_le(self.zmag);
15377 __tmp.put_f32_le(self.abs_pressure);
15378 __tmp.put_f32_le(self.diff_pressure);
15379 __tmp.put_f32_le(self.pressure_alt);
15380 __tmp.put_f32_le(self.temperature);
15381 __tmp.put_u16_le(self.fields_updated.bits());
15382 __tmp.put_u8(self.id);
15383 if matches!(version, MavlinkVersion::V2) {
15384 let len = __tmp.len();
15385 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15386 } else {
15387 __tmp.len()
15388 }
15389 }
15390}
15391#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15392#[doc = "id: 234"]
15393#[doc = "Message appropriate for high latency connections like Iridium."]
15394#[derive(Debug, Clone, PartialEq)]
15395#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15396#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15397pub struct HIGH_LATENCY_DATA {
15398 #[doc = "A bitfield for use for autopilot-specific flags."]
15399 pub custom_mode: u32,
15400 #[doc = "Latitude"]
15401 pub latitude: i32,
15402 #[doc = "Longitude"]
15403 pub longitude: i32,
15404 #[doc = "roll"]
15405 pub roll: i16,
15406 #[doc = "pitch"]
15407 pub pitch: i16,
15408 #[doc = "heading"]
15409 pub heading: u16,
15410 #[doc = "heading setpoint"]
15411 pub heading_sp: i16,
15412 #[doc = "Altitude above mean sea level"]
15413 pub altitude_amsl: i16,
15414 #[doc = "Altitude setpoint relative to the home position"]
15415 pub altitude_sp: i16,
15416 #[doc = "distance to target"]
15417 pub wp_distance: u16,
15418 #[doc = "Bitmap of enabled system modes."]
15419 pub base_mode: MavModeFlag,
15420 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15421 pub landed_state: MavLandedState,
15422 #[doc = "throttle (percentage)"]
15423 pub throttle: i8,
15424 #[doc = "airspeed"]
15425 pub airspeed: u8,
15426 #[doc = "airspeed setpoint"]
15427 pub airspeed_sp: u8,
15428 #[doc = "groundspeed"]
15429 pub groundspeed: u8,
15430 #[doc = "climb rate"]
15431 pub climb_rate: i8,
15432 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15433 pub gps_nsat: u8,
15434 #[doc = "GPS Fix type."]
15435 pub gps_fix_type: GpsFixType,
15436 #[doc = "Remaining battery (percentage)"]
15437 pub battery_remaining: u8,
15438 #[doc = "Autopilot temperature (degrees C)"]
15439 pub temperature: i8,
15440 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15441 pub temperature_air: i8,
15442 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15443 pub failsafe: u8,
15444 #[doc = "current waypoint number"]
15445 pub wp_num: u8,
15446}
15447impl HIGH_LATENCY_DATA {
15448 pub const ENCODED_LEN: usize = 40usize;
15449 pub const DEFAULT: Self = Self {
15450 custom_mode: 0_u32,
15451 latitude: 0_i32,
15452 longitude: 0_i32,
15453 roll: 0_i16,
15454 pitch: 0_i16,
15455 heading: 0_u16,
15456 heading_sp: 0_i16,
15457 altitude_amsl: 0_i16,
15458 altitude_sp: 0_i16,
15459 wp_distance: 0_u16,
15460 base_mode: MavModeFlag::DEFAULT,
15461 landed_state: MavLandedState::DEFAULT,
15462 throttle: 0_i8,
15463 airspeed: 0_u8,
15464 airspeed_sp: 0_u8,
15465 groundspeed: 0_u8,
15466 climb_rate: 0_i8,
15467 gps_nsat: 0_u8,
15468 gps_fix_type: GpsFixType::DEFAULT,
15469 battery_remaining: 0_u8,
15470 temperature: 0_i8,
15471 temperature_air: 0_i8,
15472 failsafe: 0_u8,
15473 wp_num: 0_u8,
15474 };
15475 #[cfg(feature = "arbitrary")]
15476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15477 use arbitrary::{Arbitrary, Unstructured};
15478 let mut buf = [0u8; 1024];
15479 rng.fill_bytes(&mut buf);
15480 let mut unstructured = Unstructured::new(&buf);
15481 Self::arbitrary(&mut unstructured).unwrap_or_default()
15482 }
15483}
15484impl Default for HIGH_LATENCY_DATA {
15485 fn default() -> Self {
15486 Self::DEFAULT.clone()
15487 }
15488}
15489impl MessageData for HIGH_LATENCY_DATA {
15490 type Message = MavMessage;
15491 const ID: u32 = 234u32;
15492 const NAME: &'static str = "HIGH_LATENCY";
15493 const EXTRA_CRC: u8 = 150u8;
15494 const ENCODED_LEN: usize = 40usize;
15495 fn deser(
15496 _version: MavlinkVersion,
15497 __input: &[u8],
15498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15499 let avail_len = __input.len();
15500 let mut payload_buf = [0; Self::ENCODED_LEN];
15501 let mut buf = if avail_len < Self::ENCODED_LEN {
15502 payload_buf[0..avail_len].copy_from_slice(__input);
15503 Bytes::new(&payload_buf)
15504 } else {
15505 Bytes::new(__input)
15506 };
15507 let mut __struct = Self::default();
15508 __struct.custom_mode = buf.get_u32_le();
15509 __struct.latitude = buf.get_i32_le();
15510 __struct.longitude = buf.get_i32_le();
15511 __struct.roll = buf.get_i16_le();
15512 __struct.pitch = buf.get_i16_le();
15513 __struct.heading = buf.get_u16_le();
15514 __struct.heading_sp = buf.get_i16_le();
15515 __struct.altitude_amsl = buf.get_i16_le();
15516 __struct.altitude_sp = buf.get_i16_le();
15517 __struct.wp_distance = buf.get_u16_le();
15518 let tmp = buf.get_u8();
15519 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15520 ::mavlink_core::error::ParserError::InvalidFlag {
15521 flag_type: "MavModeFlag",
15522 value: tmp as u32,
15523 },
15524 )?;
15525 let tmp = buf.get_u8();
15526 __struct.landed_state =
15527 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15528 enum_type: "MavLandedState",
15529 value: tmp as u32,
15530 })?;
15531 __struct.throttle = buf.get_i8();
15532 __struct.airspeed = buf.get_u8();
15533 __struct.airspeed_sp = buf.get_u8();
15534 __struct.groundspeed = buf.get_u8();
15535 __struct.climb_rate = buf.get_i8();
15536 __struct.gps_nsat = buf.get_u8();
15537 let tmp = buf.get_u8();
15538 __struct.gps_fix_type =
15539 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15540 enum_type: "GpsFixType",
15541 value: tmp as u32,
15542 })?;
15543 __struct.battery_remaining = buf.get_u8();
15544 __struct.temperature = buf.get_i8();
15545 __struct.temperature_air = buf.get_i8();
15546 __struct.failsafe = buf.get_u8();
15547 __struct.wp_num = buf.get_u8();
15548 Ok(__struct)
15549 }
15550 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15551 let mut __tmp = BytesMut::new(bytes);
15552 #[allow(clippy::absurd_extreme_comparisons)]
15553 #[allow(unused_comparisons)]
15554 if __tmp.remaining() < Self::ENCODED_LEN {
15555 panic!(
15556 "buffer is too small (need {} bytes, but got {})",
15557 Self::ENCODED_LEN,
15558 __tmp.remaining(),
15559 )
15560 }
15561 __tmp.put_u32_le(self.custom_mode);
15562 __tmp.put_i32_le(self.latitude);
15563 __tmp.put_i32_le(self.longitude);
15564 __tmp.put_i16_le(self.roll);
15565 __tmp.put_i16_le(self.pitch);
15566 __tmp.put_u16_le(self.heading);
15567 __tmp.put_i16_le(self.heading_sp);
15568 __tmp.put_i16_le(self.altitude_amsl);
15569 __tmp.put_i16_le(self.altitude_sp);
15570 __tmp.put_u16_le(self.wp_distance);
15571 __tmp.put_u8(self.base_mode.bits());
15572 __tmp.put_u8(self.landed_state as u8);
15573 __tmp.put_i8(self.throttle);
15574 __tmp.put_u8(self.airspeed);
15575 __tmp.put_u8(self.airspeed_sp);
15576 __tmp.put_u8(self.groundspeed);
15577 __tmp.put_i8(self.climb_rate);
15578 __tmp.put_u8(self.gps_nsat);
15579 __tmp.put_u8(self.gps_fix_type as u8);
15580 __tmp.put_u8(self.battery_remaining);
15581 __tmp.put_i8(self.temperature);
15582 __tmp.put_i8(self.temperature_air);
15583 __tmp.put_u8(self.failsafe);
15584 __tmp.put_u8(self.wp_num);
15585 if matches!(version, MavlinkVersion::V2) {
15586 let len = __tmp.len();
15587 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15588 } else {
15589 __tmp.len()
15590 }
15591 }
15592}
15593#[doc = "id: 235"]
15594#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15595#[derive(Debug, Clone, PartialEq)]
15596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15597#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15598pub struct HIGH_LATENCY2_DATA {
15599 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15600 pub timestamp: u32,
15601 #[doc = "Latitude"]
15602 pub latitude: i32,
15603 #[doc = "Longitude"]
15604 pub longitude: i32,
15605 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15606 pub custom_mode: u16,
15607 #[doc = "Altitude above mean sea level"]
15608 pub altitude: i16,
15609 #[doc = "Altitude setpoint"]
15610 pub target_altitude: i16,
15611 #[doc = "Distance to target waypoint or position"]
15612 pub target_distance: u16,
15613 #[doc = "Current waypoint number"]
15614 pub wp_num: u16,
15615 #[doc = "Bitmap of failure flags."]
15616 pub failure_flags: HlFailureFlag,
15617 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15618 pub mavtype: MavType,
15619 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15620 pub autopilot: MavAutopilot,
15621 #[doc = "Heading"]
15622 pub heading: u8,
15623 #[doc = "Heading setpoint"]
15624 pub target_heading: u8,
15625 #[doc = "Throttle"]
15626 pub throttle: u8,
15627 #[doc = "Airspeed"]
15628 pub airspeed: u8,
15629 #[doc = "Airspeed setpoint"]
15630 pub airspeed_sp: u8,
15631 #[doc = "Groundspeed"]
15632 pub groundspeed: u8,
15633 #[doc = "Windspeed"]
15634 pub windspeed: u8,
15635 #[doc = "Wind heading"]
15636 pub wind_heading: u8,
15637 #[doc = "Maximum error horizontal position since last message"]
15638 pub eph: u8,
15639 #[doc = "Maximum error vertical position since last message"]
15640 pub epv: u8,
15641 #[doc = "Air temperature"]
15642 pub temperature_air: i8,
15643 #[doc = "Maximum climb rate magnitude since last message"]
15644 pub climb_rate: i8,
15645 #[doc = "Battery level (-1 if field not provided)."]
15646 pub battery: i8,
15647 #[doc = "Field for custom payload."]
15648 pub custom0: i8,
15649 #[doc = "Field for custom payload."]
15650 pub custom1: i8,
15651 #[doc = "Field for custom payload."]
15652 pub custom2: i8,
15653}
15654impl HIGH_LATENCY2_DATA {
15655 pub const ENCODED_LEN: usize = 42usize;
15656 pub const DEFAULT: Self = Self {
15657 timestamp: 0_u32,
15658 latitude: 0_i32,
15659 longitude: 0_i32,
15660 custom_mode: 0_u16,
15661 altitude: 0_i16,
15662 target_altitude: 0_i16,
15663 target_distance: 0_u16,
15664 wp_num: 0_u16,
15665 failure_flags: HlFailureFlag::DEFAULT,
15666 mavtype: MavType::DEFAULT,
15667 autopilot: MavAutopilot::DEFAULT,
15668 heading: 0_u8,
15669 target_heading: 0_u8,
15670 throttle: 0_u8,
15671 airspeed: 0_u8,
15672 airspeed_sp: 0_u8,
15673 groundspeed: 0_u8,
15674 windspeed: 0_u8,
15675 wind_heading: 0_u8,
15676 eph: 0_u8,
15677 epv: 0_u8,
15678 temperature_air: 0_i8,
15679 climb_rate: 0_i8,
15680 battery: 0_i8,
15681 custom0: 0_i8,
15682 custom1: 0_i8,
15683 custom2: 0_i8,
15684 };
15685 #[cfg(feature = "arbitrary")]
15686 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15687 use arbitrary::{Arbitrary, Unstructured};
15688 let mut buf = [0u8; 1024];
15689 rng.fill_bytes(&mut buf);
15690 let mut unstructured = Unstructured::new(&buf);
15691 Self::arbitrary(&mut unstructured).unwrap_or_default()
15692 }
15693}
15694impl Default for HIGH_LATENCY2_DATA {
15695 fn default() -> Self {
15696 Self::DEFAULT.clone()
15697 }
15698}
15699impl MessageData for HIGH_LATENCY2_DATA {
15700 type Message = MavMessage;
15701 const ID: u32 = 235u32;
15702 const NAME: &'static str = "HIGH_LATENCY2";
15703 const EXTRA_CRC: u8 = 179u8;
15704 const ENCODED_LEN: usize = 42usize;
15705 fn deser(
15706 _version: MavlinkVersion,
15707 __input: &[u8],
15708 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15709 let avail_len = __input.len();
15710 let mut payload_buf = [0; Self::ENCODED_LEN];
15711 let mut buf = if avail_len < Self::ENCODED_LEN {
15712 payload_buf[0..avail_len].copy_from_slice(__input);
15713 Bytes::new(&payload_buf)
15714 } else {
15715 Bytes::new(__input)
15716 };
15717 let mut __struct = Self::default();
15718 __struct.timestamp = buf.get_u32_le();
15719 __struct.latitude = buf.get_i32_le();
15720 __struct.longitude = buf.get_i32_le();
15721 __struct.custom_mode = buf.get_u16_le();
15722 __struct.altitude = buf.get_i16_le();
15723 __struct.target_altitude = buf.get_i16_le();
15724 __struct.target_distance = buf.get_u16_le();
15725 __struct.wp_num = buf.get_u16_le();
15726 let tmp = buf.get_u16_le();
15727 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
15728 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15729 flag_type: "HlFailureFlag",
15730 value: tmp as u32,
15731 })?;
15732 let tmp = buf.get_u8();
15733 __struct.mavtype =
15734 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15735 enum_type: "MavType",
15736 value: tmp as u32,
15737 })?;
15738 let tmp = buf.get_u8();
15739 __struct.autopilot =
15740 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15741 enum_type: "MavAutopilot",
15742 value: tmp as u32,
15743 })?;
15744 __struct.heading = buf.get_u8();
15745 __struct.target_heading = buf.get_u8();
15746 __struct.throttle = buf.get_u8();
15747 __struct.airspeed = buf.get_u8();
15748 __struct.airspeed_sp = buf.get_u8();
15749 __struct.groundspeed = buf.get_u8();
15750 __struct.windspeed = buf.get_u8();
15751 __struct.wind_heading = buf.get_u8();
15752 __struct.eph = buf.get_u8();
15753 __struct.epv = buf.get_u8();
15754 __struct.temperature_air = buf.get_i8();
15755 __struct.climb_rate = buf.get_i8();
15756 __struct.battery = buf.get_i8();
15757 __struct.custom0 = buf.get_i8();
15758 __struct.custom1 = buf.get_i8();
15759 __struct.custom2 = buf.get_i8();
15760 Ok(__struct)
15761 }
15762 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15763 let mut __tmp = BytesMut::new(bytes);
15764 #[allow(clippy::absurd_extreme_comparisons)]
15765 #[allow(unused_comparisons)]
15766 if __tmp.remaining() < Self::ENCODED_LEN {
15767 panic!(
15768 "buffer is too small (need {} bytes, but got {})",
15769 Self::ENCODED_LEN,
15770 __tmp.remaining(),
15771 )
15772 }
15773 __tmp.put_u32_le(self.timestamp);
15774 __tmp.put_i32_le(self.latitude);
15775 __tmp.put_i32_le(self.longitude);
15776 __tmp.put_u16_le(self.custom_mode);
15777 __tmp.put_i16_le(self.altitude);
15778 __tmp.put_i16_le(self.target_altitude);
15779 __tmp.put_u16_le(self.target_distance);
15780 __tmp.put_u16_le(self.wp_num);
15781 __tmp.put_u16_le(self.failure_flags.bits());
15782 __tmp.put_u8(self.mavtype as u8);
15783 __tmp.put_u8(self.autopilot as u8);
15784 __tmp.put_u8(self.heading);
15785 __tmp.put_u8(self.target_heading);
15786 __tmp.put_u8(self.throttle);
15787 __tmp.put_u8(self.airspeed);
15788 __tmp.put_u8(self.airspeed_sp);
15789 __tmp.put_u8(self.groundspeed);
15790 __tmp.put_u8(self.windspeed);
15791 __tmp.put_u8(self.wind_heading);
15792 __tmp.put_u8(self.eph);
15793 __tmp.put_u8(self.epv);
15794 __tmp.put_i8(self.temperature_air);
15795 __tmp.put_i8(self.climb_rate);
15796 __tmp.put_i8(self.battery);
15797 __tmp.put_i8(self.custom0);
15798 __tmp.put_i8(self.custom1);
15799 __tmp.put_i8(self.custom2);
15800 if matches!(version, MavlinkVersion::V2) {
15801 let len = __tmp.len();
15802 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15803 } else {
15804 __tmp.len()
15805 }
15806 }
15807}
15808#[doc = "id: 93"]
15809#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15810#[derive(Debug, Clone, PartialEq)]
15811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15813pub struct HIL_ACTUATOR_CONTROLS_DATA {
15814 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15815 pub time_usec: u64,
15816 #[doc = "Flags bitmask."]
15817 pub flags: HilActuatorControlsFlags,
15818 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15819 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15820 pub controls: [f32; 16],
15821 #[doc = "System mode. Includes arming state."]
15822 pub mode: MavModeFlag,
15823}
15824impl HIL_ACTUATOR_CONTROLS_DATA {
15825 pub const ENCODED_LEN: usize = 81usize;
15826 pub const DEFAULT: Self = Self {
15827 time_usec: 0_u64,
15828 flags: HilActuatorControlsFlags::DEFAULT,
15829 controls: [0.0_f32; 16usize],
15830 mode: MavModeFlag::DEFAULT,
15831 };
15832 #[cfg(feature = "arbitrary")]
15833 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15834 use arbitrary::{Arbitrary, Unstructured};
15835 let mut buf = [0u8; 1024];
15836 rng.fill_bytes(&mut buf);
15837 let mut unstructured = Unstructured::new(&buf);
15838 Self::arbitrary(&mut unstructured).unwrap_or_default()
15839 }
15840}
15841impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15842 fn default() -> Self {
15843 Self::DEFAULT.clone()
15844 }
15845}
15846impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15847 type Message = MavMessage;
15848 const ID: u32 = 93u32;
15849 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15850 const EXTRA_CRC: u8 = 47u8;
15851 const ENCODED_LEN: usize = 81usize;
15852 fn deser(
15853 _version: MavlinkVersion,
15854 __input: &[u8],
15855 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15856 let avail_len = __input.len();
15857 let mut payload_buf = [0; Self::ENCODED_LEN];
15858 let mut buf = if avail_len < Self::ENCODED_LEN {
15859 payload_buf[0..avail_len].copy_from_slice(__input);
15860 Bytes::new(&payload_buf)
15861 } else {
15862 Bytes::new(__input)
15863 };
15864 let mut __struct = Self::default();
15865 __struct.time_usec = buf.get_u64_le();
15866 let tmp = buf.get_u64_le();
15867 __struct.flags =
15868 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
15869 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15870 flag_type: "HilActuatorControlsFlags",
15871 value: tmp as u32,
15872 })?;
15873 for v in &mut __struct.controls {
15874 let val = buf.get_f32_le();
15875 *v = val;
15876 }
15877 let tmp = buf.get_u8();
15878 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15879 ::mavlink_core::error::ParserError::InvalidFlag {
15880 flag_type: "MavModeFlag",
15881 value: tmp as u32,
15882 },
15883 )?;
15884 Ok(__struct)
15885 }
15886 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15887 let mut __tmp = BytesMut::new(bytes);
15888 #[allow(clippy::absurd_extreme_comparisons)]
15889 #[allow(unused_comparisons)]
15890 if __tmp.remaining() < Self::ENCODED_LEN {
15891 panic!(
15892 "buffer is too small (need {} bytes, but got {})",
15893 Self::ENCODED_LEN,
15894 __tmp.remaining(),
15895 )
15896 }
15897 __tmp.put_u64_le(self.time_usec);
15898 __tmp.put_u64_le(self.flags.bits());
15899 for val in &self.controls {
15900 __tmp.put_f32_le(*val);
15901 }
15902 __tmp.put_u8(self.mode.bits());
15903 if matches!(version, MavlinkVersion::V2) {
15904 let len = __tmp.len();
15905 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15906 } else {
15907 __tmp.len()
15908 }
15909 }
15910}
15911#[doc = "id: 91"]
15912#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15913#[derive(Debug, Clone, PartialEq)]
15914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15916pub struct HIL_CONTROLS_DATA {
15917 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15918 pub time_usec: u64,
15919 #[doc = "Control output -1 .. 1"]
15920 pub roll_ailerons: f32,
15921 #[doc = "Control output -1 .. 1"]
15922 pub pitch_elevator: f32,
15923 #[doc = "Control output -1 .. 1"]
15924 pub yaw_rudder: f32,
15925 #[doc = "Throttle 0 .. 1"]
15926 pub throttle: f32,
15927 #[doc = "Aux 1, -1 .. 1"]
15928 pub aux1: f32,
15929 #[doc = "Aux 2, -1 .. 1"]
15930 pub aux2: f32,
15931 #[doc = "Aux 3, -1 .. 1"]
15932 pub aux3: f32,
15933 #[doc = "Aux 4, -1 .. 1"]
15934 pub aux4: f32,
15935 #[doc = "System mode."]
15936 pub mode: MavMode,
15937 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15938 pub nav_mode: u8,
15939}
15940impl HIL_CONTROLS_DATA {
15941 pub const ENCODED_LEN: usize = 42usize;
15942 pub const DEFAULT: Self = Self {
15943 time_usec: 0_u64,
15944 roll_ailerons: 0.0_f32,
15945 pitch_elevator: 0.0_f32,
15946 yaw_rudder: 0.0_f32,
15947 throttle: 0.0_f32,
15948 aux1: 0.0_f32,
15949 aux2: 0.0_f32,
15950 aux3: 0.0_f32,
15951 aux4: 0.0_f32,
15952 mode: MavMode::DEFAULT,
15953 nav_mode: 0_u8,
15954 };
15955 #[cfg(feature = "arbitrary")]
15956 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15957 use arbitrary::{Arbitrary, Unstructured};
15958 let mut buf = [0u8; 1024];
15959 rng.fill_bytes(&mut buf);
15960 let mut unstructured = Unstructured::new(&buf);
15961 Self::arbitrary(&mut unstructured).unwrap_or_default()
15962 }
15963}
15964impl Default for HIL_CONTROLS_DATA {
15965 fn default() -> Self {
15966 Self::DEFAULT.clone()
15967 }
15968}
15969impl MessageData for HIL_CONTROLS_DATA {
15970 type Message = MavMessage;
15971 const ID: u32 = 91u32;
15972 const NAME: &'static str = "HIL_CONTROLS";
15973 const EXTRA_CRC: u8 = 63u8;
15974 const ENCODED_LEN: usize = 42usize;
15975 fn deser(
15976 _version: MavlinkVersion,
15977 __input: &[u8],
15978 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15979 let avail_len = __input.len();
15980 let mut payload_buf = [0; Self::ENCODED_LEN];
15981 let mut buf = if avail_len < Self::ENCODED_LEN {
15982 payload_buf[0..avail_len].copy_from_slice(__input);
15983 Bytes::new(&payload_buf)
15984 } else {
15985 Bytes::new(__input)
15986 };
15987 let mut __struct = Self::default();
15988 __struct.time_usec = buf.get_u64_le();
15989 __struct.roll_ailerons = buf.get_f32_le();
15990 __struct.pitch_elevator = buf.get_f32_le();
15991 __struct.yaw_rudder = buf.get_f32_le();
15992 __struct.throttle = buf.get_f32_le();
15993 __struct.aux1 = buf.get_f32_le();
15994 __struct.aux2 = buf.get_f32_le();
15995 __struct.aux3 = buf.get_f32_le();
15996 __struct.aux4 = buf.get_f32_le();
15997 let tmp = buf.get_u8();
15998 __struct.mode =
15999 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16000 enum_type: "MavMode",
16001 value: tmp as u32,
16002 })?;
16003 __struct.nav_mode = buf.get_u8();
16004 Ok(__struct)
16005 }
16006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16007 let mut __tmp = BytesMut::new(bytes);
16008 #[allow(clippy::absurd_extreme_comparisons)]
16009 #[allow(unused_comparisons)]
16010 if __tmp.remaining() < Self::ENCODED_LEN {
16011 panic!(
16012 "buffer is too small (need {} bytes, but got {})",
16013 Self::ENCODED_LEN,
16014 __tmp.remaining(),
16015 )
16016 }
16017 __tmp.put_u64_le(self.time_usec);
16018 __tmp.put_f32_le(self.roll_ailerons);
16019 __tmp.put_f32_le(self.pitch_elevator);
16020 __tmp.put_f32_le(self.yaw_rudder);
16021 __tmp.put_f32_le(self.throttle);
16022 __tmp.put_f32_le(self.aux1);
16023 __tmp.put_f32_le(self.aux2);
16024 __tmp.put_f32_le(self.aux3);
16025 __tmp.put_f32_le(self.aux4);
16026 __tmp.put_u8(self.mode as u8);
16027 __tmp.put_u8(self.nav_mode);
16028 if matches!(version, MavlinkVersion::V2) {
16029 let len = __tmp.len();
16030 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16031 } else {
16032 __tmp.len()
16033 }
16034 }
16035}
16036#[doc = "id: 113"]
16037#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16038#[derive(Debug, Clone, PartialEq)]
16039#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16040#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16041pub struct HIL_GPS_DATA {
16042 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16043 pub time_usec: u64,
16044 #[doc = "Latitude (WGS84)"]
16045 pub lat: i32,
16046 #[doc = "Longitude (WGS84)"]
16047 pub lon: i32,
16048 #[doc = "Altitude (MSL). Positive for up."]
16049 pub alt: i32,
16050 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16051 pub eph: u16,
16052 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16053 pub epv: u16,
16054 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
16055 pub vel: u16,
16056 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
16057 pub vn: i16,
16058 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
16059 pub ve: i16,
16060 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
16061 pub vd: i16,
16062 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
16063 pub cog: u16,
16064 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
16065 pub fix_type: u8,
16066 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16067 pub satellites_visible: u8,
16068 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
16069 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16070 pub id: u8,
16071 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
16072 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16073 pub yaw: u16,
16074}
16075impl HIL_GPS_DATA {
16076 pub const ENCODED_LEN: usize = 39usize;
16077 pub const DEFAULT: Self = Self {
16078 time_usec: 0_u64,
16079 lat: 0_i32,
16080 lon: 0_i32,
16081 alt: 0_i32,
16082 eph: 0_u16,
16083 epv: 0_u16,
16084 vel: 0_u16,
16085 vn: 0_i16,
16086 ve: 0_i16,
16087 vd: 0_i16,
16088 cog: 0_u16,
16089 fix_type: 0_u8,
16090 satellites_visible: 0_u8,
16091 id: 0_u8,
16092 yaw: 0_u16,
16093 };
16094 #[cfg(feature = "arbitrary")]
16095 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16096 use arbitrary::{Arbitrary, Unstructured};
16097 let mut buf = [0u8; 1024];
16098 rng.fill_bytes(&mut buf);
16099 let mut unstructured = Unstructured::new(&buf);
16100 Self::arbitrary(&mut unstructured).unwrap_or_default()
16101 }
16102}
16103impl Default for HIL_GPS_DATA {
16104 fn default() -> Self {
16105 Self::DEFAULT.clone()
16106 }
16107}
16108impl MessageData for HIL_GPS_DATA {
16109 type Message = MavMessage;
16110 const ID: u32 = 113u32;
16111 const NAME: &'static str = "HIL_GPS";
16112 const EXTRA_CRC: u8 = 124u8;
16113 const ENCODED_LEN: usize = 39usize;
16114 fn deser(
16115 _version: MavlinkVersion,
16116 __input: &[u8],
16117 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16118 let avail_len = __input.len();
16119 let mut payload_buf = [0; Self::ENCODED_LEN];
16120 let mut buf = if avail_len < Self::ENCODED_LEN {
16121 payload_buf[0..avail_len].copy_from_slice(__input);
16122 Bytes::new(&payload_buf)
16123 } else {
16124 Bytes::new(__input)
16125 };
16126 let mut __struct = Self::default();
16127 __struct.time_usec = buf.get_u64_le();
16128 __struct.lat = buf.get_i32_le();
16129 __struct.lon = buf.get_i32_le();
16130 __struct.alt = buf.get_i32_le();
16131 __struct.eph = buf.get_u16_le();
16132 __struct.epv = buf.get_u16_le();
16133 __struct.vel = buf.get_u16_le();
16134 __struct.vn = buf.get_i16_le();
16135 __struct.ve = buf.get_i16_le();
16136 __struct.vd = buf.get_i16_le();
16137 __struct.cog = buf.get_u16_le();
16138 __struct.fix_type = buf.get_u8();
16139 __struct.satellites_visible = buf.get_u8();
16140 __struct.id = buf.get_u8();
16141 __struct.yaw = buf.get_u16_le();
16142 Ok(__struct)
16143 }
16144 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16145 let mut __tmp = BytesMut::new(bytes);
16146 #[allow(clippy::absurd_extreme_comparisons)]
16147 #[allow(unused_comparisons)]
16148 if __tmp.remaining() < Self::ENCODED_LEN {
16149 panic!(
16150 "buffer is too small (need {} bytes, but got {})",
16151 Self::ENCODED_LEN,
16152 __tmp.remaining(),
16153 )
16154 }
16155 __tmp.put_u64_le(self.time_usec);
16156 __tmp.put_i32_le(self.lat);
16157 __tmp.put_i32_le(self.lon);
16158 __tmp.put_i32_le(self.alt);
16159 __tmp.put_u16_le(self.eph);
16160 __tmp.put_u16_le(self.epv);
16161 __tmp.put_u16_le(self.vel);
16162 __tmp.put_i16_le(self.vn);
16163 __tmp.put_i16_le(self.ve);
16164 __tmp.put_i16_le(self.vd);
16165 __tmp.put_u16_le(self.cog);
16166 __tmp.put_u8(self.fix_type);
16167 __tmp.put_u8(self.satellites_visible);
16168 __tmp.put_u8(self.id);
16169 __tmp.put_u16_le(self.yaw);
16170 if matches!(version, MavlinkVersion::V2) {
16171 let len = __tmp.len();
16172 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16173 } else {
16174 __tmp.len()
16175 }
16176 }
16177}
16178#[doc = "id: 114"]
16179#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16180#[derive(Debug, Clone, PartialEq)]
16181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16182#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16183pub struct HIL_OPTICAL_FLOW_DATA {
16184 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16185 pub time_usec: u64,
16186 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16187 pub integration_time_us: u32,
16188 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16189 pub integrated_x: f32,
16190 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16191 pub integrated_y: f32,
16192 #[doc = "RH rotation around X axis"]
16193 pub integrated_xgyro: f32,
16194 #[doc = "RH rotation around Y axis"]
16195 pub integrated_ygyro: f32,
16196 #[doc = "RH rotation around Z axis"]
16197 pub integrated_zgyro: f32,
16198 #[doc = "Time since the distance was sampled."]
16199 pub time_delta_distance_us: u32,
16200 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16201 pub distance: f32,
16202 #[doc = "Temperature"]
16203 pub temperature: i16,
16204 #[doc = "Sensor ID"]
16205 pub sensor_id: u8,
16206 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16207 pub quality: u8,
16208}
16209impl HIL_OPTICAL_FLOW_DATA {
16210 pub const ENCODED_LEN: usize = 44usize;
16211 pub const DEFAULT: Self = Self {
16212 time_usec: 0_u64,
16213 integration_time_us: 0_u32,
16214 integrated_x: 0.0_f32,
16215 integrated_y: 0.0_f32,
16216 integrated_xgyro: 0.0_f32,
16217 integrated_ygyro: 0.0_f32,
16218 integrated_zgyro: 0.0_f32,
16219 time_delta_distance_us: 0_u32,
16220 distance: 0.0_f32,
16221 temperature: 0_i16,
16222 sensor_id: 0_u8,
16223 quality: 0_u8,
16224 };
16225 #[cfg(feature = "arbitrary")]
16226 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16227 use arbitrary::{Arbitrary, Unstructured};
16228 let mut buf = [0u8; 1024];
16229 rng.fill_bytes(&mut buf);
16230 let mut unstructured = Unstructured::new(&buf);
16231 Self::arbitrary(&mut unstructured).unwrap_or_default()
16232 }
16233}
16234impl Default for HIL_OPTICAL_FLOW_DATA {
16235 fn default() -> Self {
16236 Self::DEFAULT.clone()
16237 }
16238}
16239impl MessageData for HIL_OPTICAL_FLOW_DATA {
16240 type Message = MavMessage;
16241 const ID: u32 = 114u32;
16242 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16243 const EXTRA_CRC: u8 = 237u8;
16244 const ENCODED_LEN: usize = 44usize;
16245 fn deser(
16246 _version: MavlinkVersion,
16247 __input: &[u8],
16248 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16249 let avail_len = __input.len();
16250 let mut payload_buf = [0; Self::ENCODED_LEN];
16251 let mut buf = if avail_len < Self::ENCODED_LEN {
16252 payload_buf[0..avail_len].copy_from_slice(__input);
16253 Bytes::new(&payload_buf)
16254 } else {
16255 Bytes::new(__input)
16256 };
16257 let mut __struct = Self::default();
16258 __struct.time_usec = buf.get_u64_le();
16259 __struct.integration_time_us = buf.get_u32_le();
16260 __struct.integrated_x = buf.get_f32_le();
16261 __struct.integrated_y = buf.get_f32_le();
16262 __struct.integrated_xgyro = buf.get_f32_le();
16263 __struct.integrated_ygyro = buf.get_f32_le();
16264 __struct.integrated_zgyro = buf.get_f32_le();
16265 __struct.time_delta_distance_us = buf.get_u32_le();
16266 __struct.distance = buf.get_f32_le();
16267 __struct.temperature = buf.get_i16_le();
16268 __struct.sensor_id = buf.get_u8();
16269 __struct.quality = buf.get_u8();
16270 Ok(__struct)
16271 }
16272 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16273 let mut __tmp = BytesMut::new(bytes);
16274 #[allow(clippy::absurd_extreme_comparisons)]
16275 #[allow(unused_comparisons)]
16276 if __tmp.remaining() < Self::ENCODED_LEN {
16277 panic!(
16278 "buffer is too small (need {} bytes, but got {})",
16279 Self::ENCODED_LEN,
16280 __tmp.remaining(),
16281 )
16282 }
16283 __tmp.put_u64_le(self.time_usec);
16284 __tmp.put_u32_le(self.integration_time_us);
16285 __tmp.put_f32_le(self.integrated_x);
16286 __tmp.put_f32_le(self.integrated_y);
16287 __tmp.put_f32_le(self.integrated_xgyro);
16288 __tmp.put_f32_le(self.integrated_ygyro);
16289 __tmp.put_f32_le(self.integrated_zgyro);
16290 __tmp.put_u32_le(self.time_delta_distance_us);
16291 __tmp.put_f32_le(self.distance);
16292 __tmp.put_i16_le(self.temperature);
16293 __tmp.put_u8(self.sensor_id);
16294 __tmp.put_u8(self.quality);
16295 if matches!(version, MavlinkVersion::V2) {
16296 let len = __tmp.len();
16297 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16298 } else {
16299 __tmp.len()
16300 }
16301 }
16302}
16303#[doc = "id: 92"]
16304#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16305#[derive(Debug, Clone, PartialEq)]
16306#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16307#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16308pub struct HIL_RC_INPUTS_RAW_DATA {
16309 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16310 pub time_usec: u64,
16311 #[doc = "RC channel 1 value"]
16312 pub chan1_raw: u16,
16313 #[doc = "RC channel 2 value"]
16314 pub chan2_raw: u16,
16315 #[doc = "RC channel 3 value"]
16316 pub chan3_raw: u16,
16317 #[doc = "RC channel 4 value"]
16318 pub chan4_raw: u16,
16319 #[doc = "RC channel 5 value"]
16320 pub chan5_raw: u16,
16321 #[doc = "RC channel 6 value"]
16322 pub chan6_raw: u16,
16323 #[doc = "RC channel 7 value"]
16324 pub chan7_raw: u16,
16325 #[doc = "RC channel 8 value"]
16326 pub chan8_raw: u16,
16327 #[doc = "RC channel 9 value"]
16328 pub chan9_raw: u16,
16329 #[doc = "RC channel 10 value"]
16330 pub chan10_raw: u16,
16331 #[doc = "RC channel 11 value"]
16332 pub chan11_raw: u16,
16333 #[doc = "RC channel 12 value"]
16334 pub chan12_raw: u16,
16335 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16336 pub rssi: u8,
16337}
16338impl HIL_RC_INPUTS_RAW_DATA {
16339 pub const ENCODED_LEN: usize = 33usize;
16340 pub const DEFAULT: Self = Self {
16341 time_usec: 0_u64,
16342 chan1_raw: 0_u16,
16343 chan2_raw: 0_u16,
16344 chan3_raw: 0_u16,
16345 chan4_raw: 0_u16,
16346 chan5_raw: 0_u16,
16347 chan6_raw: 0_u16,
16348 chan7_raw: 0_u16,
16349 chan8_raw: 0_u16,
16350 chan9_raw: 0_u16,
16351 chan10_raw: 0_u16,
16352 chan11_raw: 0_u16,
16353 chan12_raw: 0_u16,
16354 rssi: 0_u8,
16355 };
16356 #[cfg(feature = "arbitrary")]
16357 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16358 use arbitrary::{Arbitrary, Unstructured};
16359 let mut buf = [0u8; 1024];
16360 rng.fill_bytes(&mut buf);
16361 let mut unstructured = Unstructured::new(&buf);
16362 Self::arbitrary(&mut unstructured).unwrap_or_default()
16363 }
16364}
16365impl Default for HIL_RC_INPUTS_RAW_DATA {
16366 fn default() -> Self {
16367 Self::DEFAULT.clone()
16368 }
16369}
16370impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16371 type Message = MavMessage;
16372 const ID: u32 = 92u32;
16373 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16374 const EXTRA_CRC: u8 = 54u8;
16375 const ENCODED_LEN: usize = 33usize;
16376 fn deser(
16377 _version: MavlinkVersion,
16378 __input: &[u8],
16379 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16380 let avail_len = __input.len();
16381 let mut payload_buf = [0; Self::ENCODED_LEN];
16382 let mut buf = if avail_len < Self::ENCODED_LEN {
16383 payload_buf[0..avail_len].copy_from_slice(__input);
16384 Bytes::new(&payload_buf)
16385 } else {
16386 Bytes::new(__input)
16387 };
16388 let mut __struct = Self::default();
16389 __struct.time_usec = buf.get_u64_le();
16390 __struct.chan1_raw = buf.get_u16_le();
16391 __struct.chan2_raw = buf.get_u16_le();
16392 __struct.chan3_raw = buf.get_u16_le();
16393 __struct.chan4_raw = buf.get_u16_le();
16394 __struct.chan5_raw = buf.get_u16_le();
16395 __struct.chan6_raw = buf.get_u16_le();
16396 __struct.chan7_raw = buf.get_u16_le();
16397 __struct.chan8_raw = buf.get_u16_le();
16398 __struct.chan9_raw = buf.get_u16_le();
16399 __struct.chan10_raw = buf.get_u16_le();
16400 __struct.chan11_raw = buf.get_u16_le();
16401 __struct.chan12_raw = buf.get_u16_le();
16402 __struct.rssi = buf.get_u8();
16403 Ok(__struct)
16404 }
16405 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16406 let mut __tmp = BytesMut::new(bytes);
16407 #[allow(clippy::absurd_extreme_comparisons)]
16408 #[allow(unused_comparisons)]
16409 if __tmp.remaining() < Self::ENCODED_LEN {
16410 panic!(
16411 "buffer is too small (need {} bytes, but got {})",
16412 Self::ENCODED_LEN,
16413 __tmp.remaining(),
16414 )
16415 }
16416 __tmp.put_u64_le(self.time_usec);
16417 __tmp.put_u16_le(self.chan1_raw);
16418 __tmp.put_u16_le(self.chan2_raw);
16419 __tmp.put_u16_le(self.chan3_raw);
16420 __tmp.put_u16_le(self.chan4_raw);
16421 __tmp.put_u16_le(self.chan5_raw);
16422 __tmp.put_u16_le(self.chan6_raw);
16423 __tmp.put_u16_le(self.chan7_raw);
16424 __tmp.put_u16_le(self.chan8_raw);
16425 __tmp.put_u16_le(self.chan9_raw);
16426 __tmp.put_u16_le(self.chan10_raw);
16427 __tmp.put_u16_le(self.chan11_raw);
16428 __tmp.put_u16_le(self.chan12_raw);
16429 __tmp.put_u8(self.rssi);
16430 if matches!(version, MavlinkVersion::V2) {
16431 let len = __tmp.len();
16432 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16433 } else {
16434 __tmp.len()
16435 }
16436 }
16437}
16438#[doc = "id: 107"]
16439#[doc = "The IMU readings in SI units in NED body frame."]
16440#[derive(Debug, Clone, PartialEq)]
16441#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16442#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16443pub struct HIL_SENSOR_DATA {
16444 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16445 pub time_usec: u64,
16446 #[doc = "X acceleration"]
16447 pub xacc: f32,
16448 #[doc = "Y acceleration"]
16449 pub yacc: f32,
16450 #[doc = "Z acceleration"]
16451 pub zacc: f32,
16452 #[doc = "Angular speed around X axis in body frame"]
16453 pub xgyro: f32,
16454 #[doc = "Angular speed around Y axis in body frame"]
16455 pub ygyro: f32,
16456 #[doc = "Angular speed around Z axis in body frame"]
16457 pub zgyro: f32,
16458 #[doc = "X Magnetic field"]
16459 pub xmag: f32,
16460 #[doc = "Y Magnetic field"]
16461 pub ymag: f32,
16462 #[doc = "Z Magnetic field"]
16463 pub zmag: f32,
16464 #[doc = "Absolute pressure"]
16465 pub abs_pressure: f32,
16466 #[doc = "Differential pressure (airspeed)"]
16467 pub diff_pressure: f32,
16468 #[doc = "Altitude calculated from pressure"]
16469 pub pressure_alt: f32,
16470 #[doc = "Temperature"]
16471 pub temperature: f32,
16472 #[doc = "Bitmap for fields that have updated since last message"]
16473 pub fields_updated: HilSensorUpdatedFlags,
16474 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16475 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16476 pub id: u8,
16477}
16478impl HIL_SENSOR_DATA {
16479 pub const ENCODED_LEN: usize = 65usize;
16480 pub const DEFAULT: Self = Self {
16481 time_usec: 0_u64,
16482 xacc: 0.0_f32,
16483 yacc: 0.0_f32,
16484 zacc: 0.0_f32,
16485 xgyro: 0.0_f32,
16486 ygyro: 0.0_f32,
16487 zgyro: 0.0_f32,
16488 xmag: 0.0_f32,
16489 ymag: 0.0_f32,
16490 zmag: 0.0_f32,
16491 abs_pressure: 0.0_f32,
16492 diff_pressure: 0.0_f32,
16493 pressure_alt: 0.0_f32,
16494 temperature: 0.0_f32,
16495 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16496 id: 0_u8,
16497 };
16498 #[cfg(feature = "arbitrary")]
16499 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16500 use arbitrary::{Arbitrary, Unstructured};
16501 let mut buf = [0u8; 1024];
16502 rng.fill_bytes(&mut buf);
16503 let mut unstructured = Unstructured::new(&buf);
16504 Self::arbitrary(&mut unstructured).unwrap_or_default()
16505 }
16506}
16507impl Default for HIL_SENSOR_DATA {
16508 fn default() -> Self {
16509 Self::DEFAULT.clone()
16510 }
16511}
16512impl MessageData for HIL_SENSOR_DATA {
16513 type Message = MavMessage;
16514 const ID: u32 = 107u32;
16515 const NAME: &'static str = "HIL_SENSOR";
16516 const EXTRA_CRC: u8 = 108u8;
16517 const ENCODED_LEN: usize = 65usize;
16518 fn deser(
16519 _version: MavlinkVersion,
16520 __input: &[u8],
16521 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16522 let avail_len = __input.len();
16523 let mut payload_buf = [0; Self::ENCODED_LEN];
16524 let mut buf = if avail_len < Self::ENCODED_LEN {
16525 payload_buf[0..avail_len].copy_from_slice(__input);
16526 Bytes::new(&payload_buf)
16527 } else {
16528 Bytes::new(__input)
16529 };
16530 let mut __struct = Self::default();
16531 __struct.time_usec = buf.get_u64_le();
16532 __struct.xacc = buf.get_f32_le();
16533 __struct.yacc = buf.get_f32_le();
16534 __struct.zacc = buf.get_f32_le();
16535 __struct.xgyro = buf.get_f32_le();
16536 __struct.ygyro = buf.get_f32_le();
16537 __struct.zgyro = buf.get_f32_le();
16538 __struct.xmag = buf.get_f32_le();
16539 __struct.ymag = buf.get_f32_le();
16540 __struct.zmag = buf.get_f32_le();
16541 __struct.abs_pressure = buf.get_f32_le();
16542 __struct.diff_pressure = buf.get_f32_le();
16543 __struct.pressure_alt = buf.get_f32_le();
16544 __struct.temperature = buf.get_f32_le();
16545 let tmp = buf.get_u32_le();
16546 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16547 tmp & HilSensorUpdatedFlags::all().bits(),
16548 )
16549 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16550 flag_type: "HilSensorUpdatedFlags",
16551 value: tmp as u32,
16552 })?;
16553 __struct.id = buf.get_u8();
16554 Ok(__struct)
16555 }
16556 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16557 let mut __tmp = BytesMut::new(bytes);
16558 #[allow(clippy::absurd_extreme_comparisons)]
16559 #[allow(unused_comparisons)]
16560 if __tmp.remaining() < Self::ENCODED_LEN {
16561 panic!(
16562 "buffer is too small (need {} bytes, but got {})",
16563 Self::ENCODED_LEN,
16564 __tmp.remaining(),
16565 )
16566 }
16567 __tmp.put_u64_le(self.time_usec);
16568 __tmp.put_f32_le(self.xacc);
16569 __tmp.put_f32_le(self.yacc);
16570 __tmp.put_f32_le(self.zacc);
16571 __tmp.put_f32_le(self.xgyro);
16572 __tmp.put_f32_le(self.ygyro);
16573 __tmp.put_f32_le(self.zgyro);
16574 __tmp.put_f32_le(self.xmag);
16575 __tmp.put_f32_le(self.ymag);
16576 __tmp.put_f32_le(self.zmag);
16577 __tmp.put_f32_le(self.abs_pressure);
16578 __tmp.put_f32_le(self.diff_pressure);
16579 __tmp.put_f32_le(self.pressure_alt);
16580 __tmp.put_f32_le(self.temperature);
16581 __tmp.put_u32_le(self.fields_updated.bits());
16582 __tmp.put_u8(self.id);
16583 if matches!(version, MavlinkVersion::V2) {
16584 let len = __tmp.len();
16585 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16586 } else {
16587 __tmp.len()
16588 }
16589 }
16590}
16591#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16592#[doc = "id: 90"]
16593#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16594#[derive(Debug, Clone, PartialEq)]
16595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16597pub struct HIL_STATE_DATA {
16598 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16599 pub time_usec: u64,
16600 #[doc = "Roll angle"]
16601 pub roll: f32,
16602 #[doc = "Pitch angle"]
16603 pub pitch: f32,
16604 #[doc = "Yaw angle"]
16605 pub yaw: f32,
16606 #[doc = "Body frame roll / phi angular speed"]
16607 pub rollspeed: f32,
16608 #[doc = "Body frame pitch / theta angular speed"]
16609 pub pitchspeed: f32,
16610 #[doc = "Body frame yaw / psi angular speed"]
16611 pub yawspeed: f32,
16612 #[doc = "Latitude"]
16613 pub lat: i32,
16614 #[doc = "Longitude"]
16615 pub lon: i32,
16616 #[doc = "Altitude"]
16617 pub alt: i32,
16618 #[doc = "Ground X Speed (Latitude)"]
16619 pub vx: i16,
16620 #[doc = "Ground Y Speed (Longitude)"]
16621 pub vy: i16,
16622 #[doc = "Ground Z Speed (Altitude)"]
16623 pub vz: i16,
16624 #[doc = "X acceleration"]
16625 pub xacc: i16,
16626 #[doc = "Y acceleration"]
16627 pub yacc: i16,
16628 #[doc = "Z acceleration"]
16629 pub zacc: i16,
16630}
16631impl HIL_STATE_DATA {
16632 pub const ENCODED_LEN: usize = 56usize;
16633 pub const DEFAULT: Self = Self {
16634 time_usec: 0_u64,
16635 roll: 0.0_f32,
16636 pitch: 0.0_f32,
16637 yaw: 0.0_f32,
16638 rollspeed: 0.0_f32,
16639 pitchspeed: 0.0_f32,
16640 yawspeed: 0.0_f32,
16641 lat: 0_i32,
16642 lon: 0_i32,
16643 alt: 0_i32,
16644 vx: 0_i16,
16645 vy: 0_i16,
16646 vz: 0_i16,
16647 xacc: 0_i16,
16648 yacc: 0_i16,
16649 zacc: 0_i16,
16650 };
16651 #[cfg(feature = "arbitrary")]
16652 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16653 use arbitrary::{Arbitrary, Unstructured};
16654 let mut buf = [0u8; 1024];
16655 rng.fill_bytes(&mut buf);
16656 let mut unstructured = Unstructured::new(&buf);
16657 Self::arbitrary(&mut unstructured).unwrap_or_default()
16658 }
16659}
16660impl Default for HIL_STATE_DATA {
16661 fn default() -> Self {
16662 Self::DEFAULT.clone()
16663 }
16664}
16665impl MessageData for HIL_STATE_DATA {
16666 type Message = MavMessage;
16667 const ID: u32 = 90u32;
16668 const NAME: &'static str = "HIL_STATE";
16669 const EXTRA_CRC: u8 = 183u8;
16670 const ENCODED_LEN: usize = 56usize;
16671 fn deser(
16672 _version: MavlinkVersion,
16673 __input: &[u8],
16674 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16675 let avail_len = __input.len();
16676 let mut payload_buf = [0; Self::ENCODED_LEN];
16677 let mut buf = if avail_len < Self::ENCODED_LEN {
16678 payload_buf[0..avail_len].copy_from_slice(__input);
16679 Bytes::new(&payload_buf)
16680 } else {
16681 Bytes::new(__input)
16682 };
16683 let mut __struct = Self::default();
16684 __struct.time_usec = buf.get_u64_le();
16685 __struct.roll = buf.get_f32_le();
16686 __struct.pitch = buf.get_f32_le();
16687 __struct.yaw = buf.get_f32_le();
16688 __struct.rollspeed = buf.get_f32_le();
16689 __struct.pitchspeed = buf.get_f32_le();
16690 __struct.yawspeed = buf.get_f32_le();
16691 __struct.lat = buf.get_i32_le();
16692 __struct.lon = buf.get_i32_le();
16693 __struct.alt = buf.get_i32_le();
16694 __struct.vx = buf.get_i16_le();
16695 __struct.vy = buf.get_i16_le();
16696 __struct.vz = buf.get_i16_le();
16697 __struct.xacc = buf.get_i16_le();
16698 __struct.yacc = buf.get_i16_le();
16699 __struct.zacc = buf.get_i16_le();
16700 Ok(__struct)
16701 }
16702 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16703 let mut __tmp = BytesMut::new(bytes);
16704 #[allow(clippy::absurd_extreme_comparisons)]
16705 #[allow(unused_comparisons)]
16706 if __tmp.remaining() < Self::ENCODED_LEN {
16707 panic!(
16708 "buffer is too small (need {} bytes, but got {})",
16709 Self::ENCODED_LEN,
16710 __tmp.remaining(),
16711 )
16712 }
16713 __tmp.put_u64_le(self.time_usec);
16714 __tmp.put_f32_le(self.roll);
16715 __tmp.put_f32_le(self.pitch);
16716 __tmp.put_f32_le(self.yaw);
16717 __tmp.put_f32_le(self.rollspeed);
16718 __tmp.put_f32_le(self.pitchspeed);
16719 __tmp.put_f32_le(self.yawspeed);
16720 __tmp.put_i32_le(self.lat);
16721 __tmp.put_i32_le(self.lon);
16722 __tmp.put_i32_le(self.alt);
16723 __tmp.put_i16_le(self.vx);
16724 __tmp.put_i16_le(self.vy);
16725 __tmp.put_i16_le(self.vz);
16726 __tmp.put_i16_le(self.xacc);
16727 __tmp.put_i16_le(self.yacc);
16728 __tmp.put_i16_le(self.zacc);
16729 if matches!(version, MavlinkVersion::V2) {
16730 let len = __tmp.len();
16731 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16732 } else {
16733 __tmp.len()
16734 }
16735 }
16736}
16737#[doc = "id: 115"]
16738#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16739#[derive(Debug, Clone, PartialEq)]
16740#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16741#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16742pub struct HIL_STATE_QUATERNION_DATA {
16743 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16744 pub time_usec: u64,
16745 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16746 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16747 pub attitude_quaternion: [f32; 4],
16748 #[doc = "Body frame roll / phi angular speed"]
16749 pub rollspeed: f32,
16750 #[doc = "Body frame pitch / theta angular speed"]
16751 pub pitchspeed: f32,
16752 #[doc = "Body frame yaw / psi angular speed"]
16753 pub yawspeed: f32,
16754 #[doc = "Latitude"]
16755 pub lat: i32,
16756 #[doc = "Longitude"]
16757 pub lon: i32,
16758 #[doc = "Altitude"]
16759 pub alt: i32,
16760 #[doc = "Ground X Speed (Latitude)"]
16761 pub vx: i16,
16762 #[doc = "Ground Y Speed (Longitude)"]
16763 pub vy: i16,
16764 #[doc = "Ground Z Speed (Altitude)"]
16765 pub vz: i16,
16766 #[doc = "Indicated airspeed"]
16767 pub ind_airspeed: u16,
16768 #[doc = "True airspeed"]
16769 pub true_airspeed: u16,
16770 #[doc = "X acceleration"]
16771 pub xacc: i16,
16772 #[doc = "Y acceleration"]
16773 pub yacc: i16,
16774 #[doc = "Z acceleration"]
16775 pub zacc: i16,
16776}
16777impl HIL_STATE_QUATERNION_DATA {
16778 pub const ENCODED_LEN: usize = 64usize;
16779 pub const DEFAULT: Self = Self {
16780 time_usec: 0_u64,
16781 attitude_quaternion: [0.0_f32; 4usize],
16782 rollspeed: 0.0_f32,
16783 pitchspeed: 0.0_f32,
16784 yawspeed: 0.0_f32,
16785 lat: 0_i32,
16786 lon: 0_i32,
16787 alt: 0_i32,
16788 vx: 0_i16,
16789 vy: 0_i16,
16790 vz: 0_i16,
16791 ind_airspeed: 0_u16,
16792 true_airspeed: 0_u16,
16793 xacc: 0_i16,
16794 yacc: 0_i16,
16795 zacc: 0_i16,
16796 };
16797 #[cfg(feature = "arbitrary")]
16798 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16799 use arbitrary::{Arbitrary, Unstructured};
16800 let mut buf = [0u8; 1024];
16801 rng.fill_bytes(&mut buf);
16802 let mut unstructured = Unstructured::new(&buf);
16803 Self::arbitrary(&mut unstructured).unwrap_or_default()
16804 }
16805}
16806impl Default for HIL_STATE_QUATERNION_DATA {
16807 fn default() -> Self {
16808 Self::DEFAULT.clone()
16809 }
16810}
16811impl MessageData for HIL_STATE_QUATERNION_DATA {
16812 type Message = MavMessage;
16813 const ID: u32 = 115u32;
16814 const NAME: &'static str = "HIL_STATE_QUATERNION";
16815 const EXTRA_CRC: u8 = 4u8;
16816 const ENCODED_LEN: usize = 64usize;
16817 fn deser(
16818 _version: MavlinkVersion,
16819 __input: &[u8],
16820 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16821 let avail_len = __input.len();
16822 let mut payload_buf = [0; Self::ENCODED_LEN];
16823 let mut buf = if avail_len < Self::ENCODED_LEN {
16824 payload_buf[0..avail_len].copy_from_slice(__input);
16825 Bytes::new(&payload_buf)
16826 } else {
16827 Bytes::new(__input)
16828 };
16829 let mut __struct = Self::default();
16830 __struct.time_usec = buf.get_u64_le();
16831 for v in &mut __struct.attitude_quaternion {
16832 let val = buf.get_f32_le();
16833 *v = val;
16834 }
16835 __struct.rollspeed = buf.get_f32_le();
16836 __struct.pitchspeed = buf.get_f32_le();
16837 __struct.yawspeed = buf.get_f32_le();
16838 __struct.lat = buf.get_i32_le();
16839 __struct.lon = buf.get_i32_le();
16840 __struct.alt = buf.get_i32_le();
16841 __struct.vx = buf.get_i16_le();
16842 __struct.vy = buf.get_i16_le();
16843 __struct.vz = buf.get_i16_le();
16844 __struct.ind_airspeed = buf.get_u16_le();
16845 __struct.true_airspeed = buf.get_u16_le();
16846 __struct.xacc = buf.get_i16_le();
16847 __struct.yacc = buf.get_i16_le();
16848 __struct.zacc = buf.get_i16_le();
16849 Ok(__struct)
16850 }
16851 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16852 let mut __tmp = BytesMut::new(bytes);
16853 #[allow(clippy::absurd_extreme_comparisons)]
16854 #[allow(unused_comparisons)]
16855 if __tmp.remaining() < Self::ENCODED_LEN {
16856 panic!(
16857 "buffer is too small (need {} bytes, but got {})",
16858 Self::ENCODED_LEN,
16859 __tmp.remaining(),
16860 )
16861 }
16862 __tmp.put_u64_le(self.time_usec);
16863 for val in &self.attitude_quaternion {
16864 __tmp.put_f32_le(*val);
16865 }
16866 __tmp.put_f32_le(self.rollspeed);
16867 __tmp.put_f32_le(self.pitchspeed);
16868 __tmp.put_f32_le(self.yawspeed);
16869 __tmp.put_i32_le(self.lat);
16870 __tmp.put_i32_le(self.lon);
16871 __tmp.put_i32_le(self.alt);
16872 __tmp.put_i16_le(self.vx);
16873 __tmp.put_i16_le(self.vy);
16874 __tmp.put_i16_le(self.vz);
16875 __tmp.put_u16_le(self.ind_airspeed);
16876 __tmp.put_u16_le(self.true_airspeed);
16877 __tmp.put_i16_le(self.xacc);
16878 __tmp.put_i16_le(self.yacc);
16879 __tmp.put_i16_le(self.zacc);
16880 if matches!(version, MavlinkVersion::V2) {
16881 let len = __tmp.len();
16882 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16883 } else {
16884 __tmp.len()
16885 }
16886 }
16887}
16888#[doc = "id: 242"]
16889#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16890#[derive(Debug, Clone, PartialEq)]
16891#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16892#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16893pub struct HOME_POSITION_DATA {
16894 #[doc = "Latitude (WGS84)"]
16895 pub latitude: i32,
16896 #[doc = "Longitude (WGS84)"]
16897 pub longitude: i32,
16898 #[doc = "Altitude (MSL). Positive for up."]
16899 pub altitude: i32,
16900 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16901 pub x: f32,
16902 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16903 pub y: f32,
16904 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16905 pub z: f32,
16906 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16907 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16908 pub q: [f32; 4],
16909 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16910 pub approach_x: f32,
16911 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16912 pub approach_y: f32,
16913 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16914 pub approach_z: f32,
16915 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16916 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16917 pub time_usec: u64,
16918}
16919impl HOME_POSITION_DATA {
16920 pub const ENCODED_LEN: usize = 60usize;
16921 pub const DEFAULT: Self = Self {
16922 latitude: 0_i32,
16923 longitude: 0_i32,
16924 altitude: 0_i32,
16925 x: 0.0_f32,
16926 y: 0.0_f32,
16927 z: 0.0_f32,
16928 q: [0.0_f32; 4usize],
16929 approach_x: 0.0_f32,
16930 approach_y: 0.0_f32,
16931 approach_z: 0.0_f32,
16932 time_usec: 0_u64,
16933 };
16934 #[cfg(feature = "arbitrary")]
16935 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16936 use arbitrary::{Arbitrary, Unstructured};
16937 let mut buf = [0u8; 1024];
16938 rng.fill_bytes(&mut buf);
16939 let mut unstructured = Unstructured::new(&buf);
16940 Self::arbitrary(&mut unstructured).unwrap_or_default()
16941 }
16942}
16943impl Default for HOME_POSITION_DATA {
16944 fn default() -> Self {
16945 Self::DEFAULT.clone()
16946 }
16947}
16948impl MessageData for HOME_POSITION_DATA {
16949 type Message = MavMessage;
16950 const ID: u32 = 242u32;
16951 const NAME: &'static str = "HOME_POSITION";
16952 const EXTRA_CRC: u8 = 104u8;
16953 const ENCODED_LEN: usize = 60usize;
16954 fn deser(
16955 _version: MavlinkVersion,
16956 __input: &[u8],
16957 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16958 let avail_len = __input.len();
16959 let mut payload_buf = [0; Self::ENCODED_LEN];
16960 let mut buf = if avail_len < Self::ENCODED_LEN {
16961 payload_buf[0..avail_len].copy_from_slice(__input);
16962 Bytes::new(&payload_buf)
16963 } else {
16964 Bytes::new(__input)
16965 };
16966 let mut __struct = Self::default();
16967 __struct.latitude = buf.get_i32_le();
16968 __struct.longitude = buf.get_i32_le();
16969 __struct.altitude = buf.get_i32_le();
16970 __struct.x = buf.get_f32_le();
16971 __struct.y = buf.get_f32_le();
16972 __struct.z = buf.get_f32_le();
16973 for v in &mut __struct.q {
16974 let val = buf.get_f32_le();
16975 *v = val;
16976 }
16977 __struct.approach_x = buf.get_f32_le();
16978 __struct.approach_y = buf.get_f32_le();
16979 __struct.approach_z = buf.get_f32_le();
16980 __struct.time_usec = buf.get_u64_le();
16981 Ok(__struct)
16982 }
16983 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16984 let mut __tmp = BytesMut::new(bytes);
16985 #[allow(clippy::absurd_extreme_comparisons)]
16986 #[allow(unused_comparisons)]
16987 if __tmp.remaining() < Self::ENCODED_LEN {
16988 panic!(
16989 "buffer is too small (need {} bytes, but got {})",
16990 Self::ENCODED_LEN,
16991 __tmp.remaining(),
16992 )
16993 }
16994 __tmp.put_i32_le(self.latitude);
16995 __tmp.put_i32_le(self.longitude);
16996 __tmp.put_i32_le(self.altitude);
16997 __tmp.put_f32_le(self.x);
16998 __tmp.put_f32_le(self.y);
16999 __tmp.put_f32_le(self.z);
17000 for val in &self.q {
17001 __tmp.put_f32_le(*val);
17002 }
17003 __tmp.put_f32_le(self.approach_x);
17004 __tmp.put_f32_le(self.approach_y);
17005 __tmp.put_f32_le(self.approach_z);
17006 __tmp.put_u64_le(self.time_usec);
17007 if matches!(version, MavlinkVersion::V2) {
17008 let len = __tmp.len();
17009 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17010 } else {
17011 __tmp.len()
17012 }
17013 }
17014}
17015#[doc = "id: 12920"]
17016#[doc = "Temperature and humidity from hygrometer."]
17017#[derive(Debug, Clone, PartialEq)]
17018#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17019#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17020pub struct HYGROMETER_SENSOR_DATA {
17021 #[doc = "Temperature"]
17022 pub temperature: i16,
17023 #[doc = "Humidity"]
17024 pub humidity: u16,
17025 #[doc = "Hygrometer ID"]
17026 pub id: u8,
17027}
17028impl HYGROMETER_SENSOR_DATA {
17029 pub const ENCODED_LEN: usize = 5usize;
17030 pub const DEFAULT: Self = Self {
17031 temperature: 0_i16,
17032 humidity: 0_u16,
17033 id: 0_u8,
17034 };
17035 #[cfg(feature = "arbitrary")]
17036 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17037 use arbitrary::{Arbitrary, Unstructured};
17038 let mut buf = [0u8; 1024];
17039 rng.fill_bytes(&mut buf);
17040 let mut unstructured = Unstructured::new(&buf);
17041 Self::arbitrary(&mut unstructured).unwrap_or_default()
17042 }
17043}
17044impl Default for HYGROMETER_SENSOR_DATA {
17045 fn default() -> Self {
17046 Self::DEFAULT.clone()
17047 }
17048}
17049impl MessageData for HYGROMETER_SENSOR_DATA {
17050 type Message = MavMessage;
17051 const ID: u32 = 12920u32;
17052 const NAME: &'static str = "HYGROMETER_SENSOR";
17053 const EXTRA_CRC: u8 = 20u8;
17054 const ENCODED_LEN: usize = 5usize;
17055 fn deser(
17056 _version: MavlinkVersion,
17057 __input: &[u8],
17058 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17059 let avail_len = __input.len();
17060 let mut payload_buf = [0; Self::ENCODED_LEN];
17061 let mut buf = if avail_len < Self::ENCODED_LEN {
17062 payload_buf[0..avail_len].copy_from_slice(__input);
17063 Bytes::new(&payload_buf)
17064 } else {
17065 Bytes::new(__input)
17066 };
17067 let mut __struct = Self::default();
17068 __struct.temperature = buf.get_i16_le();
17069 __struct.humidity = buf.get_u16_le();
17070 __struct.id = buf.get_u8();
17071 Ok(__struct)
17072 }
17073 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17074 let mut __tmp = BytesMut::new(bytes);
17075 #[allow(clippy::absurd_extreme_comparisons)]
17076 #[allow(unused_comparisons)]
17077 if __tmp.remaining() < Self::ENCODED_LEN {
17078 panic!(
17079 "buffer is too small (need {} bytes, but got {})",
17080 Self::ENCODED_LEN,
17081 __tmp.remaining(),
17082 )
17083 }
17084 __tmp.put_i16_le(self.temperature);
17085 __tmp.put_u16_le(self.humidity);
17086 __tmp.put_u8(self.id);
17087 if matches!(version, MavlinkVersion::V2) {
17088 let len = __tmp.len();
17089 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17090 } else {
17091 __tmp.len()
17092 }
17093 }
17094}
17095#[doc = "id: 440"]
17096#[doc = "Illuminator status."]
17097#[derive(Debug, Clone, PartialEq)]
17098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17099#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17100pub struct ILLUMINATOR_STATUS_DATA {
17101 #[doc = "Time since the start-up of the illuminator in ms"]
17102 pub uptime_ms: u32,
17103 #[doc = "Errors"]
17104 pub error_status: IlluminatorErrorFlags,
17105 #[doc = "Illuminator brightness"]
17106 pub brightness: f32,
17107 #[doc = "Illuminator strobing period in seconds"]
17108 pub strobe_period: f32,
17109 #[doc = "Illuminator strobing duty cycle"]
17110 pub strobe_duty_cycle: f32,
17111 #[doc = "Temperature in Celsius"]
17112 pub temp_c: f32,
17113 #[doc = "Minimum strobing period in seconds"]
17114 pub min_strobe_period: f32,
17115 #[doc = "Maximum strobing period in seconds"]
17116 pub max_strobe_period: f32,
17117 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17118 pub enable: u8,
17119 #[doc = "Supported illuminator modes"]
17120 pub mode_bitmask: IlluminatorMode,
17121 #[doc = "Illuminator mode"]
17122 pub mode: IlluminatorMode,
17123}
17124impl ILLUMINATOR_STATUS_DATA {
17125 pub const ENCODED_LEN: usize = 35usize;
17126 pub const DEFAULT: Self = Self {
17127 uptime_ms: 0_u32,
17128 error_status: IlluminatorErrorFlags::DEFAULT,
17129 brightness: 0.0_f32,
17130 strobe_period: 0.0_f32,
17131 strobe_duty_cycle: 0.0_f32,
17132 temp_c: 0.0_f32,
17133 min_strobe_period: 0.0_f32,
17134 max_strobe_period: 0.0_f32,
17135 enable: 0_u8,
17136 mode_bitmask: IlluminatorMode::DEFAULT,
17137 mode: IlluminatorMode::DEFAULT,
17138 };
17139 #[cfg(feature = "arbitrary")]
17140 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17141 use arbitrary::{Arbitrary, Unstructured};
17142 let mut buf = [0u8; 1024];
17143 rng.fill_bytes(&mut buf);
17144 let mut unstructured = Unstructured::new(&buf);
17145 Self::arbitrary(&mut unstructured).unwrap_or_default()
17146 }
17147}
17148impl Default for ILLUMINATOR_STATUS_DATA {
17149 fn default() -> Self {
17150 Self::DEFAULT.clone()
17151 }
17152}
17153impl MessageData for ILLUMINATOR_STATUS_DATA {
17154 type Message = MavMessage;
17155 const ID: u32 = 440u32;
17156 const NAME: &'static str = "ILLUMINATOR_STATUS";
17157 const EXTRA_CRC: u8 = 66u8;
17158 const ENCODED_LEN: usize = 35usize;
17159 fn deser(
17160 _version: MavlinkVersion,
17161 __input: &[u8],
17162 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17163 let avail_len = __input.len();
17164 let mut payload_buf = [0; Self::ENCODED_LEN];
17165 let mut buf = if avail_len < Self::ENCODED_LEN {
17166 payload_buf[0..avail_len].copy_from_slice(__input);
17167 Bytes::new(&payload_buf)
17168 } else {
17169 Bytes::new(__input)
17170 };
17171 let mut __struct = Self::default();
17172 __struct.uptime_ms = buf.get_u32_le();
17173 let tmp = buf.get_u32_le();
17174 __struct.error_status = IlluminatorErrorFlags::from_bits(
17175 tmp & IlluminatorErrorFlags::all().bits(),
17176 )
17177 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17178 flag_type: "IlluminatorErrorFlags",
17179 value: tmp as u32,
17180 })?;
17181 __struct.brightness = buf.get_f32_le();
17182 __struct.strobe_period = buf.get_f32_le();
17183 __struct.strobe_duty_cycle = buf.get_f32_le();
17184 __struct.temp_c = buf.get_f32_le();
17185 __struct.min_strobe_period = buf.get_f32_le();
17186 __struct.max_strobe_period = buf.get_f32_le();
17187 __struct.enable = buf.get_u8();
17188 let tmp = buf.get_u8();
17189 __struct.mode_bitmask =
17190 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17191 enum_type: "IlluminatorMode",
17192 value: tmp as u32,
17193 })?;
17194 let tmp = buf.get_u8();
17195 __struct.mode =
17196 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17197 enum_type: "IlluminatorMode",
17198 value: tmp as u32,
17199 })?;
17200 Ok(__struct)
17201 }
17202 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17203 let mut __tmp = BytesMut::new(bytes);
17204 #[allow(clippy::absurd_extreme_comparisons)]
17205 #[allow(unused_comparisons)]
17206 if __tmp.remaining() < Self::ENCODED_LEN {
17207 panic!(
17208 "buffer is too small (need {} bytes, but got {})",
17209 Self::ENCODED_LEN,
17210 __tmp.remaining(),
17211 )
17212 }
17213 __tmp.put_u32_le(self.uptime_ms);
17214 __tmp.put_u32_le(self.error_status.bits());
17215 __tmp.put_f32_le(self.brightness);
17216 __tmp.put_f32_le(self.strobe_period);
17217 __tmp.put_f32_le(self.strobe_duty_cycle);
17218 __tmp.put_f32_le(self.temp_c);
17219 __tmp.put_f32_le(self.min_strobe_period);
17220 __tmp.put_f32_le(self.max_strobe_period);
17221 __tmp.put_u8(self.enable);
17222 __tmp.put_u8(self.mode_bitmask as u8);
17223 __tmp.put_u8(self.mode as u8);
17224 if matches!(version, MavlinkVersion::V2) {
17225 let len = __tmp.len();
17226 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17227 } else {
17228 __tmp.len()
17229 }
17230 }
17231}
17232#[doc = "id: 335"]
17233#[doc = "Status of the Iridium SBD link."]
17234#[derive(Debug, Clone, PartialEq)]
17235#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17236#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17237pub struct ISBD_LINK_STATUS_DATA {
17238 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17239 pub timestamp: u64,
17240 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17241 pub last_heartbeat: u64,
17242 #[doc = "Number of failed SBD sessions."]
17243 pub failed_sessions: u16,
17244 #[doc = "Number of successful SBD sessions."]
17245 pub successful_sessions: u16,
17246 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17247 pub signal_quality: u8,
17248 #[doc = "1: Ring call pending, 0: No call pending."]
17249 pub ring_pending: u8,
17250 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17251 pub tx_session_pending: u8,
17252 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17253 pub rx_session_pending: u8,
17254}
17255impl ISBD_LINK_STATUS_DATA {
17256 pub const ENCODED_LEN: usize = 24usize;
17257 pub const DEFAULT: Self = Self {
17258 timestamp: 0_u64,
17259 last_heartbeat: 0_u64,
17260 failed_sessions: 0_u16,
17261 successful_sessions: 0_u16,
17262 signal_quality: 0_u8,
17263 ring_pending: 0_u8,
17264 tx_session_pending: 0_u8,
17265 rx_session_pending: 0_u8,
17266 };
17267 #[cfg(feature = "arbitrary")]
17268 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17269 use arbitrary::{Arbitrary, Unstructured};
17270 let mut buf = [0u8; 1024];
17271 rng.fill_bytes(&mut buf);
17272 let mut unstructured = Unstructured::new(&buf);
17273 Self::arbitrary(&mut unstructured).unwrap_or_default()
17274 }
17275}
17276impl Default for ISBD_LINK_STATUS_DATA {
17277 fn default() -> Self {
17278 Self::DEFAULT.clone()
17279 }
17280}
17281impl MessageData for ISBD_LINK_STATUS_DATA {
17282 type Message = MavMessage;
17283 const ID: u32 = 335u32;
17284 const NAME: &'static str = "ISBD_LINK_STATUS";
17285 const EXTRA_CRC: u8 = 225u8;
17286 const ENCODED_LEN: usize = 24usize;
17287 fn deser(
17288 _version: MavlinkVersion,
17289 __input: &[u8],
17290 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17291 let avail_len = __input.len();
17292 let mut payload_buf = [0; Self::ENCODED_LEN];
17293 let mut buf = if avail_len < Self::ENCODED_LEN {
17294 payload_buf[0..avail_len].copy_from_slice(__input);
17295 Bytes::new(&payload_buf)
17296 } else {
17297 Bytes::new(__input)
17298 };
17299 let mut __struct = Self::default();
17300 __struct.timestamp = buf.get_u64_le();
17301 __struct.last_heartbeat = buf.get_u64_le();
17302 __struct.failed_sessions = buf.get_u16_le();
17303 __struct.successful_sessions = buf.get_u16_le();
17304 __struct.signal_quality = buf.get_u8();
17305 __struct.ring_pending = buf.get_u8();
17306 __struct.tx_session_pending = buf.get_u8();
17307 __struct.rx_session_pending = buf.get_u8();
17308 Ok(__struct)
17309 }
17310 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17311 let mut __tmp = BytesMut::new(bytes);
17312 #[allow(clippy::absurd_extreme_comparisons)]
17313 #[allow(unused_comparisons)]
17314 if __tmp.remaining() < Self::ENCODED_LEN {
17315 panic!(
17316 "buffer is too small (need {} bytes, but got {})",
17317 Self::ENCODED_LEN,
17318 __tmp.remaining(),
17319 )
17320 }
17321 __tmp.put_u64_le(self.timestamp);
17322 __tmp.put_u64_le(self.last_heartbeat);
17323 __tmp.put_u16_le(self.failed_sessions);
17324 __tmp.put_u16_le(self.successful_sessions);
17325 __tmp.put_u8(self.signal_quality);
17326 __tmp.put_u8(self.ring_pending);
17327 __tmp.put_u8(self.tx_session_pending);
17328 __tmp.put_u8(self.rx_session_pending);
17329 if matches!(version, MavlinkVersion::V2) {
17330 let len = __tmp.len();
17331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17332 } else {
17333 __tmp.len()
17334 }
17335 }
17336}
17337#[doc = "id: 149"]
17338#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17339#[derive(Debug, Clone, PartialEq)]
17340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17342pub struct LANDING_TARGET_DATA {
17343 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17344 pub time_usec: u64,
17345 #[doc = "X-axis angular offset of the target from the center of the image"]
17346 pub angle_x: f32,
17347 #[doc = "Y-axis angular offset of the target from the center of the image"]
17348 pub angle_y: f32,
17349 #[doc = "Distance to the target from the vehicle"]
17350 pub distance: f32,
17351 #[doc = "Size of target along x-axis"]
17352 pub size_x: f32,
17353 #[doc = "Size of target along y-axis"]
17354 pub size_y: f32,
17355 #[doc = "The ID of the target if multiple targets are present"]
17356 pub target_num: u8,
17357 #[doc = "Coordinate frame used for following fields."]
17358 pub frame: MavFrame,
17359 #[doc = "X Position of the landing target in MAV_FRAME"]
17360 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17361 pub x: f32,
17362 #[doc = "Y Position of the landing target in MAV_FRAME"]
17363 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17364 pub y: f32,
17365 #[doc = "Z Position of the landing target in MAV_FRAME"]
17366 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17367 pub z: f32,
17368 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17369 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17370 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17371 pub q: [f32; 4],
17372 #[doc = "Type of landing target"]
17373 #[cfg_attr(feature = "serde", serde(default))]
17374 pub mavtype: LandingTargetType,
17375 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17376 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17377 pub position_valid: u8,
17378}
17379impl LANDING_TARGET_DATA {
17380 pub const ENCODED_LEN: usize = 60usize;
17381 pub const DEFAULT: Self = Self {
17382 time_usec: 0_u64,
17383 angle_x: 0.0_f32,
17384 angle_y: 0.0_f32,
17385 distance: 0.0_f32,
17386 size_x: 0.0_f32,
17387 size_y: 0.0_f32,
17388 target_num: 0_u8,
17389 frame: MavFrame::DEFAULT,
17390 x: 0.0_f32,
17391 y: 0.0_f32,
17392 z: 0.0_f32,
17393 q: [0.0_f32; 4usize],
17394 mavtype: LandingTargetType::DEFAULT,
17395 position_valid: 0_u8,
17396 };
17397 #[cfg(feature = "arbitrary")]
17398 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17399 use arbitrary::{Arbitrary, Unstructured};
17400 let mut buf = [0u8; 1024];
17401 rng.fill_bytes(&mut buf);
17402 let mut unstructured = Unstructured::new(&buf);
17403 Self::arbitrary(&mut unstructured).unwrap_or_default()
17404 }
17405}
17406impl Default for LANDING_TARGET_DATA {
17407 fn default() -> Self {
17408 Self::DEFAULT.clone()
17409 }
17410}
17411impl MessageData for LANDING_TARGET_DATA {
17412 type Message = MavMessage;
17413 const ID: u32 = 149u32;
17414 const NAME: &'static str = "LANDING_TARGET";
17415 const EXTRA_CRC: u8 = 200u8;
17416 const ENCODED_LEN: usize = 60usize;
17417 fn deser(
17418 _version: MavlinkVersion,
17419 __input: &[u8],
17420 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17421 let avail_len = __input.len();
17422 let mut payload_buf = [0; Self::ENCODED_LEN];
17423 let mut buf = if avail_len < Self::ENCODED_LEN {
17424 payload_buf[0..avail_len].copy_from_slice(__input);
17425 Bytes::new(&payload_buf)
17426 } else {
17427 Bytes::new(__input)
17428 };
17429 let mut __struct = Self::default();
17430 __struct.time_usec = buf.get_u64_le();
17431 __struct.angle_x = buf.get_f32_le();
17432 __struct.angle_y = buf.get_f32_le();
17433 __struct.distance = buf.get_f32_le();
17434 __struct.size_x = buf.get_f32_le();
17435 __struct.size_y = buf.get_f32_le();
17436 __struct.target_num = buf.get_u8();
17437 let tmp = buf.get_u8();
17438 __struct.frame =
17439 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17440 enum_type: "MavFrame",
17441 value: tmp as u32,
17442 })?;
17443 __struct.x = buf.get_f32_le();
17444 __struct.y = buf.get_f32_le();
17445 __struct.z = buf.get_f32_le();
17446 for v in &mut __struct.q {
17447 let val = buf.get_f32_le();
17448 *v = val;
17449 }
17450 let tmp = buf.get_u8();
17451 __struct.mavtype =
17452 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17453 enum_type: "LandingTargetType",
17454 value: tmp as u32,
17455 })?;
17456 __struct.position_valid = buf.get_u8();
17457 Ok(__struct)
17458 }
17459 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17460 let mut __tmp = BytesMut::new(bytes);
17461 #[allow(clippy::absurd_extreme_comparisons)]
17462 #[allow(unused_comparisons)]
17463 if __tmp.remaining() < Self::ENCODED_LEN {
17464 panic!(
17465 "buffer is too small (need {} bytes, but got {})",
17466 Self::ENCODED_LEN,
17467 __tmp.remaining(),
17468 )
17469 }
17470 __tmp.put_u64_le(self.time_usec);
17471 __tmp.put_f32_le(self.angle_x);
17472 __tmp.put_f32_le(self.angle_y);
17473 __tmp.put_f32_le(self.distance);
17474 __tmp.put_f32_le(self.size_x);
17475 __tmp.put_f32_le(self.size_y);
17476 __tmp.put_u8(self.target_num);
17477 __tmp.put_u8(self.frame as u8);
17478 __tmp.put_f32_le(self.x);
17479 __tmp.put_f32_le(self.y);
17480 __tmp.put_f32_le(self.z);
17481 for val in &self.q {
17482 __tmp.put_f32_le(*val);
17483 }
17484 __tmp.put_u8(self.mavtype as u8);
17485 __tmp.put_u8(self.position_valid);
17486 if matches!(version, MavlinkVersion::V2) {
17487 let len = __tmp.len();
17488 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17489 } else {
17490 __tmp.len()
17491 }
17492 }
17493}
17494#[doc = "id: 8"]
17495#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17496#[derive(Debug, Clone, PartialEq)]
17497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17499pub struct LINK_NODE_STATUS_DATA {
17500 #[doc = "Timestamp (time since system boot)."]
17501 pub timestamp: u64,
17502 #[doc = "Transmit rate"]
17503 pub tx_rate: u32,
17504 #[doc = "Receive rate"]
17505 pub rx_rate: u32,
17506 #[doc = "Messages sent"]
17507 pub messages_sent: u32,
17508 #[doc = "Messages received (estimated from counting seq)"]
17509 pub messages_received: u32,
17510 #[doc = "Messages lost (estimated from counting seq)"]
17511 pub messages_lost: u32,
17512 #[doc = "Number of bytes that could not be parsed correctly."]
17513 pub rx_parse_err: u16,
17514 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17515 pub tx_overflows: u16,
17516 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17517 pub rx_overflows: u16,
17518 #[doc = "Remaining free transmit buffer space"]
17519 pub tx_buf: u8,
17520 #[doc = "Remaining free receive buffer space"]
17521 pub rx_buf: u8,
17522}
17523impl LINK_NODE_STATUS_DATA {
17524 pub const ENCODED_LEN: usize = 36usize;
17525 pub const DEFAULT: Self = Self {
17526 timestamp: 0_u64,
17527 tx_rate: 0_u32,
17528 rx_rate: 0_u32,
17529 messages_sent: 0_u32,
17530 messages_received: 0_u32,
17531 messages_lost: 0_u32,
17532 rx_parse_err: 0_u16,
17533 tx_overflows: 0_u16,
17534 rx_overflows: 0_u16,
17535 tx_buf: 0_u8,
17536 rx_buf: 0_u8,
17537 };
17538 #[cfg(feature = "arbitrary")]
17539 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17540 use arbitrary::{Arbitrary, Unstructured};
17541 let mut buf = [0u8; 1024];
17542 rng.fill_bytes(&mut buf);
17543 let mut unstructured = Unstructured::new(&buf);
17544 Self::arbitrary(&mut unstructured).unwrap_or_default()
17545 }
17546}
17547impl Default for LINK_NODE_STATUS_DATA {
17548 fn default() -> Self {
17549 Self::DEFAULT.clone()
17550 }
17551}
17552impl MessageData for LINK_NODE_STATUS_DATA {
17553 type Message = MavMessage;
17554 const ID: u32 = 8u32;
17555 const NAME: &'static str = "LINK_NODE_STATUS";
17556 const EXTRA_CRC: u8 = 117u8;
17557 const ENCODED_LEN: usize = 36usize;
17558 fn deser(
17559 _version: MavlinkVersion,
17560 __input: &[u8],
17561 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17562 let avail_len = __input.len();
17563 let mut payload_buf = [0; Self::ENCODED_LEN];
17564 let mut buf = if avail_len < Self::ENCODED_LEN {
17565 payload_buf[0..avail_len].copy_from_slice(__input);
17566 Bytes::new(&payload_buf)
17567 } else {
17568 Bytes::new(__input)
17569 };
17570 let mut __struct = Self::default();
17571 __struct.timestamp = buf.get_u64_le();
17572 __struct.tx_rate = buf.get_u32_le();
17573 __struct.rx_rate = buf.get_u32_le();
17574 __struct.messages_sent = buf.get_u32_le();
17575 __struct.messages_received = buf.get_u32_le();
17576 __struct.messages_lost = buf.get_u32_le();
17577 __struct.rx_parse_err = buf.get_u16_le();
17578 __struct.tx_overflows = buf.get_u16_le();
17579 __struct.rx_overflows = buf.get_u16_le();
17580 __struct.tx_buf = buf.get_u8();
17581 __struct.rx_buf = buf.get_u8();
17582 Ok(__struct)
17583 }
17584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17585 let mut __tmp = BytesMut::new(bytes);
17586 #[allow(clippy::absurd_extreme_comparisons)]
17587 #[allow(unused_comparisons)]
17588 if __tmp.remaining() < Self::ENCODED_LEN {
17589 panic!(
17590 "buffer is too small (need {} bytes, but got {})",
17591 Self::ENCODED_LEN,
17592 __tmp.remaining(),
17593 )
17594 }
17595 __tmp.put_u64_le(self.timestamp);
17596 __tmp.put_u32_le(self.tx_rate);
17597 __tmp.put_u32_le(self.rx_rate);
17598 __tmp.put_u32_le(self.messages_sent);
17599 __tmp.put_u32_le(self.messages_received);
17600 __tmp.put_u32_le(self.messages_lost);
17601 __tmp.put_u16_le(self.rx_parse_err);
17602 __tmp.put_u16_le(self.tx_overflows);
17603 __tmp.put_u16_le(self.rx_overflows);
17604 __tmp.put_u8(self.tx_buf);
17605 __tmp.put_u8(self.rx_buf);
17606 if matches!(version, MavlinkVersion::V2) {
17607 let len = __tmp.len();
17608 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17609 } else {
17610 __tmp.len()
17611 }
17612 }
17613}
17614#[doc = "id: 32"]
17615#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17616#[derive(Debug, Clone, PartialEq)]
17617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17619pub struct LOCAL_POSITION_NED_DATA {
17620 #[doc = "Timestamp (time since system boot)."]
17621 pub time_boot_ms: u32,
17622 #[doc = "X Position"]
17623 pub x: f32,
17624 #[doc = "Y Position"]
17625 pub y: f32,
17626 #[doc = "Z Position"]
17627 pub z: f32,
17628 #[doc = "X Speed"]
17629 pub vx: f32,
17630 #[doc = "Y Speed"]
17631 pub vy: f32,
17632 #[doc = "Z Speed"]
17633 pub vz: f32,
17634}
17635impl LOCAL_POSITION_NED_DATA {
17636 pub const ENCODED_LEN: usize = 28usize;
17637 pub const DEFAULT: Self = Self {
17638 time_boot_ms: 0_u32,
17639 x: 0.0_f32,
17640 y: 0.0_f32,
17641 z: 0.0_f32,
17642 vx: 0.0_f32,
17643 vy: 0.0_f32,
17644 vz: 0.0_f32,
17645 };
17646 #[cfg(feature = "arbitrary")]
17647 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17648 use arbitrary::{Arbitrary, Unstructured};
17649 let mut buf = [0u8; 1024];
17650 rng.fill_bytes(&mut buf);
17651 let mut unstructured = Unstructured::new(&buf);
17652 Self::arbitrary(&mut unstructured).unwrap_or_default()
17653 }
17654}
17655impl Default for LOCAL_POSITION_NED_DATA {
17656 fn default() -> Self {
17657 Self::DEFAULT.clone()
17658 }
17659}
17660impl MessageData for LOCAL_POSITION_NED_DATA {
17661 type Message = MavMessage;
17662 const ID: u32 = 32u32;
17663 const NAME: &'static str = "LOCAL_POSITION_NED";
17664 const EXTRA_CRC: u8 = 185u8;
17665 const ENCODED_LEN: usize = 28usize;
17666 fn deser(
17667 _version: MavlinkVersion,
17668 __input: &[u8],
17669 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17670 let avail_len = __input.len();
17671 let mut payload_buf = [0; Self::ENCODED_LEN];
17672 let mut buf = if avail_len < Self::ENCODED_LEN {
17673 payload_buf[0..avail_len].copy_from_slice(__input);
17674 Bytes::new(&payload_buf)
17675 } else {
17676 Bytes::new(__input)
17677 };
17678 let mut __struct = Self::default();
17679 __struct.time_boot_ms = buf.get_u32_le();
17680 __struct.x = buf.get_f32_le();
17681 __struct.y = buf.get_f32_le();
17682 __struct.z = buf.get_f32_le();
17683 __struct.vx = buf.get_f32_le();
17684 __struct.vy = buf.get_f32_le();
17685 __struct.vz = buf.get_f32_le();
17686 Ok(__struct)
17687 }
17688 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17689 let mut __tmp = BytesMut::new(bytes);
17690 #[allow(clippy::absurd_extreme_comparisons)]
17691 #[allow(unused_comparisons)]
17692 if __tmp.remaining() < Self::ENCODED_LEN {
17693 panic!(
17694 "buffer is too small (need {} bytes, but got {})",
17695 Self::ENCODED_LEN,
17696 __tmp.remaining(),
17697 )
17698 }
17699 __tmp.put_u32_le(self.time_boot_ms);
17700 __tmp.put_f32_le(self.x);
17701 __tmp.put_f32_le(self.y);
17702 __tmp.put_f32_le(self.z);
17703 __tmp.put_f32_le(self.vx);
17704 __tmp.put_f32_le(self.vy);
17705 __tmp.put_f32_le(self.vz);
17706 if matches!(version, MavlinkVersion::V2) {
17707 let len = __tmp.len();
17708 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17709 } else {
17710 __tmp.len()
17711 }
17712 }
17713}
17714#[doc = "id: 64"]
17715#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17716#[derive(Debug, Clone, PartialEq)]
17717#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17718#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17719pub struct LOCAL_POSITION_NED_COV_DATA {
17720 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17721 pub time_usec: u64,
17722 #[doc = "X Position"]
17723 pub x: f32,
17724 #[doc = "Y Position"]
17725 pub y: f32,
17726 #[doc = "Z Position"]
17727 pub z: f32,
17728 #[doc = "X Speed"]
17729 pub vx: f32,
17730 #[doc = "Y Speed"]
17731 pub vy: f32,
17732 #[doc = "Z Speed"]
17733 pub vz: f32,
17734 #[doc = "X Acceleration"]
17735 pub ax: f32,
17736 #[doc = "Y Acceleration"]
17737 pub ay: f32,
17738 #[doc = "Z Acceleration"]
17739 pub az: f32,
17740 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17741 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17742 pub covariance: [f32; 45],
17743 #[doc = "Class id of the estimator this estimate originated from."]
17744 pub estimator_type: MavEstimatorType,
17745}
17746impl LOCAL_POSITION_NED_COV_DATA {
17747 pub const ENCODED_LEN: usize = 225usize;
17748 pub const DEFAULT: Self = Self {
17749 time_usec: 0_u64,
17750 x: 0.0_f32,
17751 y: 0.0_f32,
17752 z: 0.0_f32,
17753 vx: 0.0_f32,
17754 vy: 0.0_f32,
17755 vz: 0.0_f32,
17756 ax: 0.0_f32,
17757 ay: 0.0_f32,
17758 az: 0.0_f32,
17759 covariance: [0.0_f32; 45usize],
17760 estimator_type: MavEstimatorType::DEFAULT,
17761 };
17762 #[cfg(feature = "arbitrary")]
17763 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17764 use arbitrary::{Arbitrary, Unstructured};
17765 let mut buf = [0u8; 1024];
17766 rng.fill_bytes(&mut buf);
17767 let mut unstructured = Unstructured::new(&buf);
17768 Self::arbitrary(&mut unstructured).unwrap_or_default()
17769 }
17770}
17771impl Default for LOCAL_POSITION_NED_COV_DATA {
17772 fn default() -> Self {
17773 Self::DEFAULT.clone()
17774 }
17775}
17776impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17777 type Message = MavMessage;
17778 const ID: u32 = 64u32;
17779 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17780 const EXTRA_CRC: u8 = 191u8;
17781 const ENCODED_LEN: usize = 225usize;
17782 fn deser(
17783 _version: MavlinkVersion,
17784 __input: &[u8],
17785 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17786 let avail_len = __input.len();
17787 let mut payload_buf = [0; Self::ENCODED_LEN];
17788 let mut buf = if avail_len < Self::ENCODED_LEN {
17789 payload_buf[0..avail_len].copy_from_slice(__input);
17790 Bytes::new(&payload_buf)
17791 } else {
17792 Bytes::new(__input)
17793 };
17794 let mut __struct = Self::default();
17795 __struct.time_usec = buf.get_u64_le();
17796 __struct.x = buf.get_f32_le();
17797 __struct.y = buf.get_f32_le();
17798 __struct.z = buf.get_f32_le();
17799 __struct.vx = buf.get_f32_le();
17800 __struct.vy = buf.get_f32_le();
17801 __struct.vz = buf.get_f32_le();
17802 __struct.ax = buf.get_f32_le();
17803 __struct.ay = buf.get_f32_le();
17804 __struct.az = buf.get_f32_le();
17805 for v in &mut __struct.covariance {
17806 let val = buf.get_f32_le();
17807 *v = val;
17808 }
17809 let tmp = buf.get_u8();
17810 __struct.estimator_type =
17811 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17812 enum_type: "MavEstimatorType",
17813 value: tmp as u32,
17814 })?;
17815 Ok(__struct)
17816 }
17817 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17818 let mut __tmp = BytesMut::new(bytes);
17819 #[allow(clippy::absurd_extreme_comparisons)]
17820 #[allow(unused_comparisons)]
17821 if __tmp.remaining() < Self::ENCODED_LEN {
17822 panic!(
17823 "buffer is too small (need {} bytes, but got {})",
17824 Self::ENCODED_LEN,
17825 __tmp.remaining(),
17826 )
17827 }
17828 __tmp.put_u64_le(self.time_usec);
17829 __tmp.put_f32_le(self.x);
17830 __tmp.put_f32_le(self.y);
17831 __tmp.put_f32_le(self.z);
17832 __tmp.put_f32_le(self.vx);
17833 __tmp.put_f32_le(self.vy);
17834 __tmp.put_f32_le(self.vz);
17835 __tmp.put_f32_le(self.ax);
17836 __tmp.put_f32_le(self.ay);
17837 __tmp.put_f32_le(self.az);
17838 for val in &self.covariance {
17839 __tmp.put_f32_le(*val);
17840 }
17841 __tmp.put_u8(self.estimator_type as u8);
17842 if matches!(version, MavlinkVersion::V2) {
17843 let len = __tmp.len();
17844 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17845 } else {
17846 __tmp.len()
17847 }
17848 }
17849}
17850#[doc = "id: 89"]
17851#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17852#[derive(Debug, Clone, PartialEq)]
17853#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17854#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17855pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17856 #[doc = "Timestamp (time since system boot)."]
17857 pub time_boot_ms: u32,
17858 #[doc = "X Position"]
17859 pub x: f32,
17860 #[doc = "Y Position"]
17861 pub y: f32,
17862 #[doc = "Z Position"]
17863 pub z: f32,
17864 #[doc = "Roll"]
17865 pub roll: f32,
17866 #[doc = "Pitch"]
17867 pub pitch: f32,
17868 #[doc = "Yaw"]
17869 pub yaw: f32,
17870}
17871impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17872 pub const ENCODED_LEN: usize = 28usize;
17873 pub const DEFAULT: Self = Self {
17874 time_boot_ms: 0_u32,
17875 x: 0.0_f32,
17876 y: 0.0_f32,
17877 z: 0.0_f32,
17878 roll: 0.0_f32,
17879 pitch: 0.0_f32,
17880 yaw: 0.0_f32,
17881 };
17882 #[cfg(feature = "arbitrary")]
17883 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17884 use arbitrary::{Arbitrary, Unstructured};
17885 let mut buf = [0u8; 1024];
17886 rng.fill_bytes(&mut buf);
17887 let mut unstructured = Unstructured::new(&buf);
17888 Self::arbitrary(&mut unstructured).unwrap_or_default()
17889 }
17890}
17891impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17892 fn default() -> Self {
17893 Self::DEFAULT.clone()
17894 }
17895}
17896impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17897 type Message = MavMessage;
17898 const ID: u32 = 89u32;
17899 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17900 const EXTRA_CRC: u8 = 231u8;
17901 const ENCODED_LEN: usize = 28usize;
17902 fn deser(
17903 _version: MavlinkVersion,
17904 __input: &[u8],
17905 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17906 let avail_len = __input.len();
17907 let mut payload_buf = [0; Self::ENCODED_LEN];
17908 let mut buf = if avail_len < Self::ENCODED_LEN {
17909 payload_buf[0..avail_len].copy_from_slice(__input);
17910 Bytes::new(&payload_buf)
17911 } else {
17912 Bytes::new(__input)
17913 };
17914 let mut __struct = Self::default();
17915 __struct.time_boot_ms = buf.get_u32_le();
17916 __struct.x = buf.get_f32_le();
17917 __struct.y = buf.get_f32_le();
17918 __struct.z = buf.get_f32_le();
17919 __struct.roll = buf.get_f32_le();
17920 __struct.pitch = buf.get_f32_le();
17921 __struct.yaw = buf.get_f32_le();
17922 Ok(__struct)
17923 }
17924 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17925 let mut __tmp = BytesMut::new(bytes);
17926 #[allow(clippy::absurd_extreme_comparisons)]
17927 #[allow(unused_comparisons)]
17928 if __tmp.remaining() < Self::ENCODED_LEN {
17929 panic!(
17930 "buffer is too small (need {} bytes, but got {})",
17931 Self::ENCODED_LEN,
17932 __tmp.remaining(),
17933 )
17934 }
17935 __tmp.put_u32_le(self.time_boot_ms);
17936 __tmp.put_f32_le(self.x);
17937 __tmp.put_f32_le(self.y);
17938 __tmp.put_f32_le(self.z);
17939 __tmp.put_f32_le(self.roll);
17940 __tmp.put_f32_le(self.pitch);
17941 __tmp.put_f32_le(self.yaw);
17942 if matches!(version, MavlinkVersion::V2) {
17943 let len = __tmp.len();
17944 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17945 } else {
17946 __tmp.len()
17947 }
17948 }
17949}
17950#[doc = "id: 268"]
17951#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17952#[derive(Debug, Clone, PartialEq)]
17953#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17954#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17955pub struct LOGGING_ACK_DATA {
17956 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17957 pub sequence: u16,
17958 #[doc = "system ID of the target"]
17959 pub target_system: u8,
17960 #[doc = "component ID of the target"]
17961 pub target_component: u8,
17962}
17963impl LOGGING_ACK_DATA {
17964 pub const ENCODED_LEN: usize = 4usize;
17965 pub const DEFAULT: Self = Self {
17966 sequence: 0_u16,
17967 target_system: 0_u8,
17968 target_component: 0_u8,
17969 };
17970 #[cfg(feature = "arbitrary")]
17971 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17972 use arbitrary::{Arbitrary, Unstructured};
17973 let mut buf = [0u8; 1024];
17974 rng.fill_bytes(&mut buf);
17975 let mut unstructured = Unstructured::new(&buf);
17976 Self::arbitrary(&mut unstructured).unwrap_or_default()
17977 }
17978}
17979impl Default for LOGGING_ACK_DATA {
17980 fn default() -> Self {
17981 Self::DEFAULT.clone()
17982 }
17983}
17984impl MessageData for LOGGING_ACK_DATA {
17985 type Message = MavMessage;
17986 const ID: u32 = 268u32;
17987 const NAME: &'static str = "LOGGING_ACK";
17988 const EXTRA_CRC: u8 = 14u8;
17989 const ENCODED_LEN: usize = 4usize;
17990 fn deser(
17991 _version: MavlinkVersion,
17992 __input: &[u8],
17993 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17994 let avail_len = __input.len();
17995 let mut payload_buf = [0; Self::ENCODED_LEN];
17996 let mut buf = if avail_len < Self::ENCODED_LEN {
17997 payload_buf[0..avail_len].copy_from_slice(__input);
17998 Bytes::new(&payload_buf)
17999 } else {
18000 Bytes::new(__input)
18001 };
18002 let mut __struct = Self::default();
18003 __struct.sequence = buf.get_u16_le();
18004 __struct.target_system = buf.get_u8();
18005 __struct.target_component = buf.get_u8();
18006 Ok(__struct)
18007 }
18008 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18009 let mut __tmp = BytesMut::new(bytes);
18010 #[allow(clippy::absurd_extreme_comparisons)]
18011 #[allow(unused_comparisons)]
18012 if __tmp.remaining() < Self::ENCODED_LEN {
18013 panic!(
18014 "buffer is too small (need {} bytes, but got {})",
18015 Self::ENCODED_LEN,
18016 __tmp.remaining(),
18017 )
18018 }
18019 __tmp.put_u16_le(self.sequence);
18020 __tmp.put_u8(self.target_system);
18021 __tmp.put_u8(self.target_component);
18022 if matches!(version, MavlinkVersion::V2) {
18023 let len = __tmp.len();
18024 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18025 } else {
18026 __tmp.len()
18027 }
18028 }
18029}
18030#[doc = "id: 266"]
18031#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18032#[derive(Debug, Clone, PartialEq)]
18033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18035pub struct LOGGING_DATA_DATA {
18036 #[doc = "sequence number (can wrap)"]
18037 pub sequence: u16,
18038 #[doc = "system ID of the target"]
18039 pub target_system: u8,
18040 #[doc = "component ID of the target"]
18041 pub target_component: u8,
18042 #[doc = "data length"]
18043 pub length: u8,
18044 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18045 pub first_message_offset: u8,
18046 #[doc = "logged data"]
18047 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18048 pub data: [u8; 249],
18049}
18050impl LOGGING_DATA_DATA {
18051 pub const ENCODED_LEN: usize = 255usize;
18052 pub const DEFAULT: Self = Self {
18053 sequence: 0_u16,
18054 target_system: 0_u8,
18055 target_component: 0_u8,
18056 length: 0_u8,
18057 first_message_offset: 0_u8,
18058 data: [0_u8; 249usize],
18059 };
18060 #[cfg(feature = "arbitrary")]
18061 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18062 use arbitrary::{Arbitrary, Unstructured};
18063 let mut buf = [0u8; 1024];
18064 rng.fill_bytes(&mut buf);
18065 let mut unstructured = Unstructured::new(&buf);
18066 Self::arbitrary(&mut unstructured).unwrap_or_default()
18067 }
18068}
18069impl Default for LOGGING_DATA_DATA {
18070 fn default() -> Self {
18071 Self::DEFAULT.clone()
18072 }
18073}
18074impl MessageData for LOGGING_DATA_DATA {
18075 type Message = MavMessage;
18076 const ID: u32 = 266u32;
18077 const NAME: &'static str = "LOGGING_DATA";
18078 const EXTRA_CRC: u8 = 193u8;
18079 const ENCODED_LEN: usize = 255usize;
18080 fn deser(
18081 _version: MavlinkVersion,
18082 __input: &[u8],
18083 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18084 let avail_len = __input.len();
18085 let mut payload_buf = [0; Self::ENCODED_LEN];
18086 let mut buf = if avail_len < Self::ENCODED_LEN {
18087 payload_buf[0..avail_len].copy_from_slice(__input);
18088 Bytes::new(&payload_buf)
18089 } else {
18090 Bytes::new(__input)
18091 };
18092 let mut __struct = Self::default();
18093 __struct.sequence = buf.get_u16_le();
18094 __struct.target_system = buf.get_u8();
18095 __struct.target_component = buf.get_u8();
18096 __struct.length = buf.get_u8();
18097 __struct.first_message_offset = buf.get_u8();
18098 for v in &mut __struct.data {
18099 let val = buf.get_u8();
18100 *v = val;
18101 }
18102 Ok(__struct)
18103 }
18104 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18105 let mut __tmp = BytesMut::new(bytes);
18106 #[allow(clippy::absurd_extreme_comparisons)]
18107 #[allow(unused_comparisons)]
18108 if __tmp.remaining() < Self::ENCODED_LEN {
18109 panic!(
18110 "buffer is too small (need {} bytes, but got {})",
18111 Self::ENCODED_LEN,
18112 __tmp.remaining(),
18113 )
18114 }
18115 __tmp.put_u16_le(self.sequence);
18116 __tmp.put_u8(self.target_system);
18117 __tmp.put_u8(self.target_component);
18118 __tmp.put_u8(self.length);
18119 __tmp.put_u8(self.first_message_offset);
18120 for val in &self.data {
18121 __tmp.put_u8(*val);
18122 }
18123 if matches!(version, MavlinkVersion::V2) {
18124 let len = __tmp.len();
18125 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18126 } else {
18127 __tmp.len()
18128 }
18129 }
18130}
18131#[doc = "id: 267"]
18132#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18133#[derive(Debug, Clone, PartialEq)]
18134#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18136pub struct LOGGING_DATA_ACKED_DATA {
18137 #[doc = "sequence number (can wrap)"]
18138 pub sequence: u16,
18139 #[doc = "system ID of the target"]
18140 pub target_system: u8,
18141 #[doc = "component ID of the target"]
18142 pub target_component: u8,
18143 #[doc = "data length"]
18144 pub length: u8,
18145 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18146 pub first_message_offset: u8,
18147 #[doc = "logged data"]
18148 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18149 pub data: [u8; 249],
18150}
18151impl LOGGING_DATA_ACKED_DATA {
18152 pub const ENCODED_LEN: usize = 255usize;
18153 pub const DEFAULT: Self = Self {
18154 sequence: 0_u16,
18155 target_system: 0_u8,
18156 target_component: 0_u8,
18157 length: 0_u8,
18158 first_message_offset: 0_u8,
18159 data: [0_u8; 249usize],
18160 };
18161 #[cfg(feature = "arbitrary")]
18162 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18163 use arbitrary::{Arbitrary, Unstructured};
18164 let mut buf = [0u8; 1024];
18165 rng.fill_bytes(&mut buf);
18166 let mut unstructured = Unstructured::new(&buf);
18167 Self::arbitrary(&mut unstructured).unwrap_or_default()
18168 }
18169}
18170impl Default for LOGGING_DATA_ACKED_DATA {
18171 fn default() -> Self {
18172 Self::DEFAULT.clone()
18173 }
18174}
18175impl MessageData for LOGGING_DATA_ACKED_DATA {
18176 type Message = MavMessage;
18177 const ID: u32 = 267u32;
18178 const NAME: &'static str = "LOGGING_DATA_ACKED";
18179 const EXTRA_CRC: u8 = 35u8;
18180 const ENCODED_LEN: usize = 255usize;
18181 fn deser(
18182 _version: MavlinkVersion,
18183 __input: &[u8],
18184 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18185 let avail_len = __input.len();
18186 let mut payload_buf = [0; Self::ENCODED_LEN];
18187 let mut buf = if avail_len < Self::ENCODED_LEN {
18188 payload_buf[0..avail_len].copy_from_slice(__input);
18189 Bytes::new(&payload_buf)
18190 } else {
18191 Bytes::new(__input)
18192 };
18193 let mut __struct = Self::default();
18194 __struct.sequence = buf.get_u16_le();
18195 __struct.target_system = buf.get_u8();
18196 __struct.target_component = buf.get_u8();
18197 __struct.length = buf.get_u8();
18198 __struct.first_message_offset = buf.get_u8();
18199 for v in &mut __struct.data {
18200 let val = buf.get_u8();
18201 *v = val;
18202 }
18203 Ok(__struct)
18204 }
18205 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18206 let mut __tmp = BytesMut::new(bytes);
18207 #[allow(clippy::absurd_extreme_comparisons)]
18208 #[allow(unused_comparisons)]
18209 if __tmp.remaining() < Self::ENCODED_LEN {
18210 panic!(
18211 "buffer is too small (need {} bytes, but got {})",
18212 Self::ENCODED_LEN,
18213 __tmp.remaining(),
18214 )
18215 }
18216 __tmp.put_u16_le(self.sequence);
18217 __tmp.put_u8(self.target_system);
18218 __tmp.put_u8(self.target_component);
18219 __tmp.put_u8(self.length);
18220 __tmp.put_u8(self.first_message_offset);
18221 for val in &self.data {
18222 __tmp.put_u8(*val);
18223 }
18224 if matches!(version, MavlinkVersion::V2) {
18225 let len = __tmp.len();
18226 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18227 } else {
18228 __tmp.len()
18229 }
18230 }
18231}
18232#[doc = "id: 120"]
18233#[doc = "Reply to LOG_REQUEST_DATA."]
18234#[derive(Debug, Clone, PartialEq)]
18235#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18236#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18237pub struct LOG_DATA_DATA {
18238 #[doc = "Offset into the log"]
18239 pub ofs: u32,
18240 #[doc = "Log id (from LOG_ENTRY reply)"]
18241 pub id: u16,
18242 #[doc = "Number of bytes (zero for end of log)"]
18243 pub count: u8,
18244 #[doc = "log data"]
18245 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18246 pub data: [u8; 90],
18247}
18248impl LOG_DATA_DATA {
18249 pub const ENCODED_LEN: usize = 97usize;
18250 pub const DEFAULT: Self = Self {
18251 ofs: 0_u32,
18252 id: 0_u16,
18253 count: 0_u8,
18254 data: [0_u8; 90usize],
18255 };
18256 #[cfg(feature = "arbitrary")]
18257 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18258 use arbitrary::{Arbitrary, Unstructured};
18259 let mut buf = [0u8; 1024];
18260 rng.fill_bytes(&mut buf);
18261 let mut unstructured = Unstructured::new(&buf);
18262 Self::arbitrary(&mut unstructured).unwrap_or_default()
18263 }
18264}
18265impl Default for LOG_DATA_DATA {
18266 fn default() -> Self {
18267 Self::DEFAULT.clone()
18268 }
18269}
18270impl MessageData for LOG_DATA_DATA {
18271 type Message = MavMessage;
18272 const ID: u32 = 120u32;
18273 const NAME: &'static str = "LOG_DATA";
18274 const EXTRA_CRC: u8 = 134u8;
18275 const ENCODED_LEN: usize = 97usize;
18276 fn deser(
18277 _version: MavlinkVersion,
18278 __input: &[u8],
18279 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18280 let avail_len = __input.len();
18281 let mut payload_buf = [0; Self::ENCODED_LEN];
18282 let mut buf = if avail_len < Self::ENCODED_LEN {
18283 payload_buf[0..avail_len].copy_from_slice(__input);
18284 Bytes::new(&payload_buf)
18285 } else {
18286 Bytes::new(__input)
18287 };
18288 let mut __struct = Self::default();
18289 __struct.ofs = buf.get_u32_le();
18290 __struct.id = buf.get_u16_le();
18291 __struct.count = buf.get_u8();
18292 for v in &mut __struct.data {
18293 let val = buf.get_u8();
18294 *v = val;
18295 }
18296 Ok(__struct)
18297 }
18298 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18299 let mut __tmp = BytesMut::new(bytes);
18300 #[allow(clippy::absurd_extreme_comparisons)]
18301 #[allow(unused_comparisons)]
18302 if __tmp.remaining() < Self::ENCODED_LEN {
18303 panic!(
18304 "buffer is too small (need {} bytes, but got {})",
18305 Self::ENCODED_LEN,
18306 __tmp.remaining(),
18307 )
18308 }
18309 __tmp.put_u32_le(self.ofs);
18310 __tmp.put_u16_le(self.id);
18311 __tmp.put_u8(self.count);
18312 for val in &self.data {
18313 __tmp.put_u8(*val);
18314 }
18315 if matches!(version, MavlinkVersion::V2) {
18316 let len = __tmp.len();
18317 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18318 } else {
18319 __tmp.len()
18320 }
18321 }
18322}
18323#[doc = "id: 118"]
18324#[doc = "Reply to LOG_REQUEST_LIST."]
18325#[derive(Debug, Clone, PartialEq)]
18326#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18327#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18328pub struct LOG_ENTRY_DATA {
18329 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18330 pub time_utc: u32,
18331 #[doc = "Size of the log (may be approximate)"]
18332 pub size: u32,
18333 #[doc = "Log id"]
18334 pub id: u16,
18335 #[doc = "Total number of logs"]
18336 pub num_logs: u16,
18337 #[doc = "High log number"]
18338 pub last_log_num: u16,
18339}
18340impl LOG_ENTRY_DATA {
18341 pub const ENCODED_LEN: usize = 14usize;
18342 pub const DEFAULT: Self = Self {
18343 time_utc: 0_u32,
18344 size: 0_u32,
18345 id: 0_u16,
18346 num_logs: 0_u16,
18347 last_log_num: 0_u16,
18348 };
18349 #[cfg(feature = "arbitrary")]
18350 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18351 use arbitrary::{Arbitrary, Unstructured};
18352 let mut buf = [0u8; 1024];
18353 rng.fill_bytes(&mut buf);
18354 let mut unstructured = Unstructured::new(&buf);
18355 Self::arbitrary(&mut unstructured).unwrap_or_default()
18356 }
18357}
18358impl Default for LOG_ENTRY_DATA {
18359 fn default() -> Self {
18360 Self::DEFAULT.clone()
18361 }
18362}
18363impl MessageData for LOG_ENTRY_DATA {
18364 type Message = MavMessage;
18365 const ID: u32 = 118u32;
18366 const NAME: &'static str = "LOG_ENTRY";
18367 const EXTRA_CRC: u8 = 56u8;
18368 const ENCODED_LEN: usize = 14usize;
18369 fn deser(
18370 _version: MavlinkVersion,
18371 __input: &[u8],
18372 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18373 let avail_len = __input.len();
18374 let mut payload_buf = [0; Self::ENCODED_LEN];
18375 let mut buf = if avail_len < Self::ENCODED_LEN {
18376 payload_buf[0..avail_len].copy_from_slice(__input);
18377 Bytes::new(&payload_buf)
18378 } else {
18379 Bytes::new(__input)
18380 };
18381 let mut __struct = Self::default();
18382 __struct.time_utc = buf.get_u32_le();
18383 __struct.size = buf.get_u32_le();
18384 __struct.id = buf.get_u16_le();
18385 __struct.num_logs = buf.get_u16_le();
18386 __struct.last_log_num = buf.get_u16_le();
18387 Ok(__struct)
18388 }
18389 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18390 let mut __tmp = BytesMut::new(bytes);
18391 #[allow(clippy::absurd_extreme_comparisons)]
18392 #[allow(unused_comparisons)]
18393 if __tmp.remaining() < Self::ENCODED_LEN {
18394 panic!(
18395 "buffer is too small (need {} bytes, but got {})",
18396 Self::ENCODED_LEN,
18397 __tmp.remaining(),
18398 )
18399 }
18400 __tmp.put_u32_le(self.time_utc);
18401 __tmp.put_u32_le(self.size);
18402 __tmp.put_u16_le(self.id);
18403 __tmp.put_u16_le(self.num_logs);
18404 __tmp.put_u16_le(self.last_log_num);
18405 if matches!(version, MavlinkVersion::V2) {
18406 let len = __tmp.len();
18407 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18408 } else {
18409 __tmp.len()
18410 }
18411 }
18412}
18413#[doc = "id: 121"]
18414#[doc = "Erase all logs."]
18415#[derive(Debug, Clone, PartialEq)]
18416#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18417#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18418pub struct LOG_ERASE_DATA {
18419 #[doc = "System ID"]
18420 pub target_system: u8,
18421 #[doc = "Component ID"]
18422 pub target_component: u8,
18423}
18424impl LOG_ERASE_DATA {
18425 pub const ENCODED_LEN: usize = 2usize;
18426 pub const DEFAULT: Self = Self {
18427 target_system: 0_u8,
18428 target_component: 0_u8,
18429 };
18430 #[cfg(feature = "arbitrary")]
18431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18432 use arbitrary::{Arbitrary, Unstructured};
18433 let mut buf = [0u8; 1024];
18434 rng.fill_bytes(&mut buf);
18435 let mut unstructured = Unstructured::new(&buf);
18436 Self::arbitrary(&mut unstructured).unwrap_or_default()
18437 }
18438}
18439impl Default for LOG_ERASE_DATA {
18440 fn default() -> Self {
18441 Self::DEFAULT.clone()
18442 }
18443}
18444impl MessageData for LOG_ERASE_DATA {
18445 type Message = MavMessage;
18446 const ID: u32 = 121u32;
18447 const NAME: &'static str = "LOG_ERASE";
18448 const EXTRA_CRC: u8 = 237u8;
18449 const ENCODED_LEN: usize = 2usize;
18450 fn deser(
18451 _version: MavlinkVersion,
18452 __input: &[u8],
18453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18454 let avail_len = __input.len();
18455 let mut payload_buf = [0; Self::ENCODED_LEN];
18456 let mut buf = if avail_len < Self::ENCODED_LEN {
18457 payload_buf[0..avail_len].copy_from_slice(__input);
18458 Bytes::new(&payload_buf)
18459 } else {
18460 Bytes::new(__input)
18461 };
18462 let mut __struct = Self::default();
18463 __struct.target_system = buf.get_u8();
18464 __struct.target_component = buf.get_u8();
18465 Ok(__struct)
18466 }
18467 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18468 let mut __tmp = BytesMut::new(bytes);
18469 #[allow(clippy::absurd_extreme_comparisons)]
18470 #[allow(unused_comparisons)]
18471 if __tmp.remaining() < Self::ENCODED_LEN {
18472 panic!(
18473 "buffer is too small (need {} bytes, but got {})",
18474 Self::ENCODED_LEN,
18475 __tmp.remaining(),
18476 )
18477 }
18478 __tmp.put_u8(self.target_system);
18479 __tmp.put_u8(self.target_component);
18480 if matches!(version, MavlinkVersion::V2) {
18481 let len = __tmp.len();
18482 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18483 } else {
18484 __tmp.len()
18485 }
18486 }
18487}
18488#[doc = "id: 119"]
18489#[doc = "Request a chunk of a log."]
18490#[derive(Debug, Clone, PartialEq)]
18491#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18493pub struct LOG_REQUEST_DATA_DATA {
18494 #[doc = "Offset into the log"]
18495 pub ofs: u32,
18496 #[doc = "Number of bytes"]
18497 pub count: u32,
18498 #[doc = "Log id (from LOG_ENTRY reply)"]
18499 pub id: u16,
18500 #[doc = "System ID"]
18501 pub target_system: u8,
18502 #[doc = "Component ID"]
18503 pub target_component: u8,
18504}
18505impl LOG_REQUEST_DATA_DATA {
18506 pub const ENCODED_LEN: usize = 12usize;
18507 pub const DEFAULT: Self = Self {
18508 ofs: 0_u32,
18509 count: 0_u32,
18510 id: 0_u16,
18511 target_system: 0_u8,
18512 target_component: 0_u8,
18513 };
18514 #[cfg(feature = "arbitrary")]
18515 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18516 use arbitrary::{Arbitrary, Unstructured};
18517 let mut buf = [0u8; 1024];
18518 rng.fill_bytes(&mut buf);
18519 let mut unstructured = Unstructured::new(&buf);
18520 Self::arbitrary(&mut unstructured).unwrap_or_default()
18521 }
18522}
18523impl Default for LOG_REQUEST_DATA_DATA {
18524 fn default() -> Self {
18525 Self::DEFAULT.clone()
18526 }
18527}
18528impl MessageData for LOG_REQUEST_DATA_DATA {
18529 type Message = MavMessage;
18530 const ID: u32 = 119u32;
18531 const NAME: &'static str = "LOG_REQUEST_DATA";
18532 const EXTRA_CRC: u8 = 116u8;
18533 const ENCODED_LEN: usize = 12usize;
18534 fn deser(
18535 _version: MavlinkVersion,
18536 __input: &[u8],
18537 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18538 let avail_len = __input.len();
18539 let mut payload_buf = [0; Self::ENCODED_LEN];
18540 let mut buf = if avail_len < Self::ENCODED_LEN {
18541 payload_buf[0..avail_len].copy_from_slice(__input);
18542 Bytes::new(&payload_buf)
18543 } else {
18544 Bytes::new(__input)
18545 };
18546 let mut __struct = Self::default();
18547 __struct.ofs = buf.get_u32_le();
18548 __struct.count = buf.get_u32_le();
18549 __struct.id = buf.get_u16_le();
18550 __struct.target_system = buf.get_u8();
18551 __struct.target_component = buf.get_u8();
18552 Ok(__struct)
18553 }
18554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18555 let mut __tmp = BytesMut::new(bytes);
18556 #[allow(clippy::absurd_extreme_comparisons)]
18557 #[allow(unused_comparisons)]
18558 if __tmp.remaining() < Self::ENCODED_LEN {
18559 panic!(
18560 "buffer is too small (need {} bytes, but got {})",
18561 Self::ENCODED_LEN,
18562 __tmp.remaining(),
18563 )
18564 }
18565 __tmp.put_u32_le(self.ofs);
18566 __tmp.put_u32_le(self.count);
18567 __tmp.put_u16_le(self.id);
18568 __tmp.put_u8(self.target_system);
18569 __tmp.put_u8(self.target_component);
18570 if matches!(version, MavlinkVersion::V2) {
18571 let len = __tmp.len();
18572 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18573 } else {
18574 __tmp.len()
18575 }
18576 }
18577}
18578#[doc = "id: 122"]
18579#[doc = "Stop log transfer and resume normal logging."]
18580#[derive(Debug, Clone, PartialEq)]
18581#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18583pub struct LOG_REQUEST_END_DATA {
18584 #[doc = "System ID"]
18585 pub target_system: u8,
18586 #[doc = "Component ID"]
18587 pub target_component: u8,
18588}
18589impl LOG_REQUEST_END_DATA {
18590 pub const ENCODED_LEN: usize = 2usize;
18591 pub const DEFAULT: Self = Self {
18592 target_system: 0_u8,
18593 target_component: 0_u8,
18594 };
18595 #[cfg(feature = "arbitrary")]
18596 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18597 use arbitrary::{Arbitrary, Unstructured};
18598 let mut buf = [0u8; 1024];
18599 rng.fill_bytes(&mut buf);
18600 let mut unstructured = Unstructured::new(&buf);
18601 Self::arbitrary(&mut unstructured).unwrap_or_default()
18602 }
18603}
18604impl Default for LOG_REQUEST_END_DATA {
18605 fn default() -> Self {
18606 Self::DEFAULT.clone()
18607 }
18608}
18609impl MessageData for LOG_REQUEST_END_DATA {
18610 type Message = MavMessage;
18611 const ID: u32 = 122u32;
18612 const NAME: &'static str = "LOG_REQUEST_END";
18613 const EXTRA_CRC: u8 = 203u8;
18614 const ENCODED_LEN: usize = 2usize;
18615 fn deser(
18616 _version: MavlinkVersion,
18617 __input: &[u8],
18618 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18619 let avail_len = __input.len();
18620 let mut payload_buf = [0; Self::ENCODED_LEN];
18621 let mut buf = if avail_len < Self::ENCODED_LEN {
18622 payload_buf[0..avail_len].copy_from_slice(__input);
18623 Bytes::new(&payload_buf)
18624 } else {
18625 Bytes::new(__input)
18626 };
18627 let mut __struct = Self::default();
18628 __struct.target_system = buf.get_u8();
18629 __struct.target_component = buf.get_u8();
18630 Ok(__struct)
18631 }
18632 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18633 let mut __tmp = BytesMut::new(bytes);
18634 #[allow(clippy::absurd_extreme_comparisons)]
18635 #[allow(unused_comparisons)]
18636 if __tmp.remaining() < Self::ENCODED_LEN {
18637 panic!(
18638 "buffer is too small (need {} bytes, but got {})",
18639 Self::ENCODED_LEN,
18640 __tmp.remaining(),
18641 )
18642 }
18643 __tmp.put_u8(self.target_system);
18644 __tmp.put_u8(self.target_component);
18645 if matches!(version, MavlinkVersion::V2) {
18646 let len = __tmp.len();
18647 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18648 } else {
18649 __tmp.len()
18650 }
18651 }
18652}
18653#[doc = "id: 117"]
18654#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18655#[derive(Debug, Clone, PartialEq)]
18656#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18658pub struct LOG_REQUEST_LIST_DATA {
18659 #[doc = "First log id (0 for first available)"]
18660 pub start: u16,
18661 #[doc = "Last log id (0xffff for last available)"]
18662 pub end: u16,
18663 #[doc = "System ID"]
18664 pub target_system: u8,
18665 #[doc = "Component ID"]
18666 pub target_component: u8,
18667}
18668impl LOG_REQUEST_LIST_DATA {
18669 pub const ENCODED_LEN: usize = 6usize;
18670 pub const DEFAULT: Self = Self {
18671 start: 0_u16,
18672 end: 0_u16,
18673 target_system: 0_u8,
18674 target_component: 0_u8,
18675 };
18676 #[cfg(feature = "arbitrary")]
18677 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18678 use arbitrary::{Arbitrary, Unstructured};
18679 let mut buf = [0u8; 1024];
18680 rng.fill_bytes(&mut buf);
18681 let mut unstructured = Unstructured::new(&buf);
18682 Self::arbitrary(&mut unstructured).unwrap_or_default()
18683 }
18684}
18685impl Default for LOG_REQUEST_LIST_DATA {
18686 fn default() -> Self {
18687 Self::DEFAULT.clone()
18688 }
18689}
18690impl MessageData for LOG_REQUEST_LIST_DATA {
18691 type Message = MavMessage;
18692 const ID: u32 = 117u32;
18693 const NAME: &'static str = "LOG_REQUEST_LIST";
18694 const EXTRA_CRC: u8 = 128u8;
18695 const ENCODED_LEN: usize = 6usize;
18696 fn deser(
18697 _version: MavlinkVersion,
18698 __input: &[u8],
18699 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18700 let avail_len = __input.len();
18701 let mut payload_buf = [0; Self::ENCODED_LEN];
18702 let mut buf = if avail_len < Self::ENCODED_LEN {
18703 payload_buf[0..avail_len].copy_from_slice(__input);
18704 Bytes::new(&payload_buf)
18705 } else {
18706 Bytes::new(__input)
18707 };
18708 let mut __struct = Self::default();
18709 __struct.start = buf.get_u16_le();
18710 __struct.end = buf.get_u16_le();
18711 __struct.target_system = buf.get_u8();
18712 __struct.target_component = buf.get_u8();
18713 Ok(__struct)
18714 }
18715 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18716 let mut __tmp = BytesMut::new(bytes);
18717 #[allow(clippy::absurd_extreme_comparisons)]
18718 #[allow(unused_comparisons)]
18719 if __tmp.remaining() < Self::ENCODED_LEN {
18720 panic!(
18721 "buffer is too small (need {} bytes, but got {})",
18722 Self::ENCODED_LEN,
18723 __tmp.remaining(),
18724 )
18725 }
18726 __tmp.put_u16_le(self.start);
18727 __tmp.put_u16_le(self.end);
18728 __tmp.put_u8(self.target_system);
18729 __tmp.put_u8(self.target_component);
18730 if matches!(version, MavlinkVersion::V2) {
18731 let len = __tmp.len();
18732 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18733 } else {
18734 __tmp.len()
18735 }
18736 }
18737}
18738#[doc = "id: 192"]
18739#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18740#[derive(Debug, Clone, PartialEq)]
18741#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18742#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18743pub struct MAG_CAL_REPORT_DATA {
18744 #[doc = "RMS milligauss residuals."]
18745 pub fitness: f32,
18746 #[doc = "X offset."]
18747 pub ofs_x: f32,
18748 #[doc = "Y offset."]
18749 pub ofs_y: f32,
18750 #[doc = "Z offset."]
18751 pub ofs_z: f32,
18752 #[doc = "X diagonal (matrix 11)."]
18753 pub diag_x: f32,
18754 #[doc = "Y diagonal (matrix 22)."]
18755 pub diag_y: f32,
18756 #[doc = "Z diagonal (matrix 33)."]
18757 pub diag_z: f32,
18758 #[doc = "X off-diagonal (matrix 12 and 21)."]
18759 pub offdiag_x: f32,
18760 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18761 pub offdiag_y: f32,
18762 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18763 pub offdiag_z: f32,
18764 #[doc = "Compass being calibrated."]
18765 pub compass_id: u8,
18766 #[doc = "Bitmask of compasses being calibrated."]
18767 pub cal_mask: u8,
18768 #[doc = "Calibration Status."]
18769 pub cal_status: MagCalStatus,
18770 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18771 pub autosaved: u8,
18772 #[doc = "Confidence in orientation (higher is better)."]
18773 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18774 pub orientation_confidence: f32,
18775 #[doc = "orientation before calibration."]
18776 #[cfg_attr(feature = "serde", serde(default))]
18777 pub old_orientation: MavSensorOrientation,
18778 #[doc = "orientation after calibration."]
18779 #[cfg_attr(feature = "serde", serde(default))]
18780 pub new_orientation: MavSensorOrientation,
18781 #[doc = "field radius correction factor"]
18782 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18783 pub scale_factor: f32,
18784}
18785impl MAG_CAL_REPORT_DATA {
18786 pub const ENCODED_LEN: usize = 54usize;
18787 pub const DEFAULT: Self = Self {
18788 fitness: 0.0_f32,
18789 ofs_x: 0.0_f32,
18790 ofs_y: 0.0_f32,
18791 ofs_z: 0.0_f32,
18792 diag_x: 0.0_f32,
18793 diag_y: 0.0_f32,
18794 diag_z: 0.0_f32,
18795 offdiag_x: 0.0_f32,
18796 offdiag_y: 0.0_f32,
18797 offdiag_z: 0.0_f32,
18798 compass_id: 0_u8,
18799 cal_mask: 0_u8,
18800 cal_status: MagCalStatus::DEFAULT,
18801 autosaved: 0_u8,
18802 orientation_confidence: 0.0_f32,
18803 old_orientation: MavSensorOrientation::DEFAULT,
18804 new_orientation: MavSensorOrientation::DEFAULT,
18805 scale_factor: 0.0_f32,
18806 };
18807 #[cfg(feature = "arbitrary")]
18808 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18809 use arbitrary::{Arbitrary, Unstructured};
18810 let mut buf = [0u8; 1024];
18811 rng.fill_bytes(&mut buf);
18812 let mut unstructured = Unstructured::new(&buf);
18813 Self::arbitrary(&mut unstructured).unwrap_or_default()
18814 }
18815}
18816impl Default for MAG_CAL_REPORT_DATA {
18817 fn default() -> Self {
18818 Self::DEFAULT.clone()
18819 }
18820}
18821impl MessageData for MAG_CAL_REPORT_DATA {
18822 type Message = MavMessage;
18823 const ID: u32 = 192u32;
18824 const NAME: &'static str = "MAG_CAL_REPORT";
18825 const EXTRA_CRC: u8 = 36u8;
18826 const ENCODED_LEN: usize = 54usize;
18827 fn deser(
18828 _version: MavlinkVersion,
18829 __input: &[u8],
18830 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18831 let avail_len = __input.len();
18832 let mut payload_buf = [0; Self::ENCODED_LEN];
18833 let mut buf = if avail_len < Self::ENCODED_LEN {
18834 payload_buf[0..avail_len].copy_from_slice(__input);
18835 Bytes::new(&payload_buf)
18836 } else {
18837 Bytes::new(__input)
18838 };
18839 let mut __struct = Self::default();
18840 __struct.fitness = buf.get_f32_le();
18841 __struct.ofs_x = buf.get_f32_le();
18842 __struct.ofs_y = buf.get_f32_le();
18843 __struct.ofs_z = buf.get_f32_le();
18844 __struct.diag_x = buf.get_f32_le();
18845 __struct.diag_y = buf.get_f32_le();
18846 __struct.diag_z = buf.get_f32_le();
18847 __struct.offdiag_x = buf.get_f32_le();
18848 __struct.offdiag_y = buf.get_f32_le();
18849 __struct.offdiag_z = buf.get_f32_le();
18850 __struct.compass_id = buf.get_u8();
18851 __struct.cal_mask = buf.get_u8();
18852 let tmp = buf.get_u8();
18853 __struct.cal_status =
18854 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18855 enum_type: "MagCalStatus",
18856 value: tmp as u32,
18857 })?;
18858 __struct.autosaved = buf.get_u8();
18859 __struct.orientation_confidence = buf.get_f32_le();
18860 let tmp = buf.get_u8();
18861 __struct.old_orientation =
18862 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18863 enum_type: "MavSensorOrientation",
18864 value: tmp as u32,
18865 })?;
18866 let tmp = buf.get_u8();
18867 __struct.new_orientation =
18868 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18869 enum_type: "MavSensorOrientation",
18870 value: tmp as u32,
18871 })?;
18872 __struct.scale_factor = buf.get_f32_le();
18873 Ok(__struct)
18874 }
18875 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18876 let mut __tmp = BytesMut::new(bytes);
18877 #[allow(clippy::absurd_extreme_comparisons)]
18878 #[allow(unused_comparisons)]
18879 if __tmp.remaining() < Self::ENCODED_LEN {
18880 panic!(
18881 "buffer is too small (need {} bytes, but got {})",
18882 Self::ENCODED_LEN,
18883 __tmp.remaining(),
18884 )
18885 }
18886 __tmp.put_f32_le(self.fitness);
18887 __tmp.put_f32_le(self.ofs_x);
18888 __tmp.put_f32_le(self.ofs_y);
18889 __tmp.put_f32_le(self.ofs_z);
18890 __tmp.put_f32_le(self.diag_x);
18891 __tmp.put_f32_le(self.diag_y);
18892 __tmp.put_f32_le(self.diag_z);
18893 __tmp.put_f32_le(self.offdiag_x);
18894 __tmp.put_f32_le(self.offdiag_y);
18895 __tmp.put_f32_le(self.offdiag_z);
18896 __tmp.put_u8(self.compass_id);
18897 __tmp.put_u8(self.cal_mask);
18898 __tmp.put_u8(self.cal_status as u8);
18899 __tmp.put_u8(self.autosaved);
18900 __tmp.put_f32_le(self.orientation_confidence);
18901 __tmp.put_u8(self.old_orientation as u8);
18902 __tmp.put_u8(self.new_orientation as u8);
18903 __tmp.put_f32_le(self.scale_factor);
18904 if matches!(version, MavlinkVersion::V2) {
18905 let len = __tmp.len();
18906 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18907 } else {
18908 __tmp.len()
18909 }
18910 }
18911}
18912#[doc = "id: 69"]
18913#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18914#[derive(Debug, Clone, PartialEq)]
18915#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18916#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18917pub struct MANUAL_CONTROL_DATA {
18918 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18919 pub x: i16,
18920 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18921 pub y: i16,
18922 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18923 pub z: i16,
18924 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18925 pub r: i16,
18926 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18927 pub buttons: u16,
18928 #[doc = "The system to be controlled."]
18929 pub target: u8,
18930 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18931 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18932 pub buttons2: u16,
18933 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18934 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18935 pub enabled_extensions: u8,
18936 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18937 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18938 pub s: i16,
18939 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18940 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18941 pub t: i16,
18942 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18943 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18944 pub aux1: i16,
18945 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18946 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18947 pub aux2: i16,
18948 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18949 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18950 pub aux3: i16,
18951 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18952 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18953 pub aux4: i16,
18954 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18955 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18956 pub aux5: i16,
18957 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18958 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18959 pub aux6: i16,
18960}
18961impl MANUAL_CONTROL_DATA {
18962 pub const ENCODED_LEN: usize = 30usize;
18963 pub const DEFAULT: Self = Self {
18964 x: 0_i16,
18965 y: 0_i16,
18966 z: 0_i16,
18967 r: 0_i16,
18968 buttons: 0_u16,
18969 target: 0_u8,
18970 buttons2: 0_u16,
18971 enabled_extensions: 0_u8,
18972 s: 0_i16,
18973 t: 0_i16,
18974 aux1: 0_i16,
18975 aux2: 0_i16,
18976 aux3: 0_i16,
18977 aux4: 0_i16,
18978 aux5: 0_i16,
18979 aux6: 0_i16,
18980 };
18981 #[cfg(feature = "arbitrary")]
18982 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18983 use arbitrary::{Arbitrary, Unstructured};
18984 let mut buf = [0u8; 1024];
18985 rng.fill_bytes(&mut buf);
18986 let mut unstructured = Unstructured::new(&buf);
18987 Self::arbitrary(&mut unstructured).unwrap_or_default()
18988 }
18989}
18990impl Default for MANUAL_CONTROL_DATA {
18991 fn default() -> Self {
18992 Self::DEFAULT.clone()
18993 }
18994}
18995impl MessageData for MANUAL_CONTROL_DATA {
18996 type Message = MavMessage;
18997 const ID: u32 = 69u32;
18998 const NAME: &'static str = "MANUAL_CONTROL";
18999 const EXTRA_CRC: u8 = 243u8;
19000 const ENCODED_LEN: usize = 30usize;
19001 fn deser(
19002 _version: MavlinkVersion,
19003 __input: &[u8],
19004 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19005 let avail_len = __input.len();
19006 let mut payload_buf = [0; Self::ENCODED_LEN];
19007 let mut buf = if avail_len < Self::ENCODED_LEN {
19008 payload_buf[0..avail_len].copy_from_slice(__input);
19009 Bytes::new(&payload_buf)
19010 } else {
19011 Bytes::new(__input)
19012 };
19013 let mut __struct = Self::default();
19014 __struct.x = buf.get_i16_le();
19015 __struct.y = buf.get_i16_le();
19016 __struct.z = buf.get_i16_le();
19017 __struct.r = buf.get_i16_le();
19018 __struct.buttons = buf.get_u16_le();
19019 __struct.target = buf.get_u8();
19020 __struct.buttons2 = buf.get_u16_le();
19021 __struct.enabled_extensions = buf.get_u8();
19022 __struct.s = buf.get_i16_le();
19023 __struct.t = buf.get_i16_le();
19024 __struct.aux1 = buf.get_i16_le();
19025 __struct.aux2 = buf.get_i16_le();
19026 __struct.aux3 = buf.get_i16_le();
19027 __struct.aux4 = buf.get_i16_le();
19028 __struct.aux5 = buf.get_i16_le();
19029 __struct.aux6 = buf.get_i16_le();
19030 Ok(__struct)
19031 }
19032 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19033 let mut __tmp = BytesMut::new(bytes);
19034 #[allow(clippy::absurd_extreme_comparisons)]
19035 #[allow(unused_comparisons)]
19036 if __tmp.remaining() < Self::ENCODED_LEN {
19037 panic!(
19038 "buffer is too small (need {} bytes, but got {})",
19039 Self::ENCODED_LEN,
19040 __tmp.remaining(),
19041 )
19042 }
19043 __tmp.put_i16_le(self.x);
19044 __tmp.put_i16_le(self.y);
19045 __tmp.put_i16_le(self.z);
19046 __tmp.put_i16_le(self.r);
19047 __tmp.put_u16_le(self.buttons);
19048 __tmp.put_u8(self.target);
19049 __tmp.put_u16_le(self.buttons2);
19050 __tmp.put_u8(self.enabled_extensions);
19051 __tmp.put_i16_le(self.s);
19052 __tmp.put_i16_le(self.t);
19053 __tmp.put_i16_le(self.aux1);
19054 __tmp.put_i16_le(self.aux2);
19055 __tmp.put_i16_le(self.aux3);
19056 __tmp.put_i16_le(self.aux4);
19057 __tmp.put_i16_le(self.aux5);
19058 __tmp.put_i16_le(self.aux6);
19059 if matches!(version, MavlinkVersion::V2) {
19060 let len = __tmp.len();
19061 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19062 } else {
19063 __tmp.len()
19064 }
19065 }
19066}
19067#[doc = "id: 81"]
19068#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19069#[derive(Debug, Clone, PartialEq)]
19070#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19071#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19072pub struct MANUAL_SETPOINT_DATA {
19073 #[doc = "Timestamp (time since system boot)."]
19074 pub time_boot_ms: u32,
19075 #[doc = "Desired roll rate"]
19076 pub roll: f32,
19077 #[doc = "Desired pitch rate"]
19078 pub pitch: f32,
19079 #[doc = "Desired yaw rate"]
19080 pub yaw: f32,
19081 #[doc = "Collective thrust, normalized to 0 .. 1"]
19082 pub thrust: f32,
19083 #[doc = "Flight mode switch position, 0.. 255"]
19084 pub mode_switch: u8,
19085 #[doc = "Override mode switch position, 0.. 255"]
19086 pub manual_override_switch: u8,
19087}
19088impl MANUAL_SETPOINT_DATA {
19089 pub const ENCODED_LEN: usize = 22usize;
19090 pub const DEFAULT: Self = Self {
19091 time_boot_ms: 0_u32,
19092 roll: 0.0_f32,
19093 pitch: 0.0_f32,
19094 yaw: 0.0_f32,
19095 thrust: 0.0_f32,
19096 mode_switch: 0_u8,
19097 manual_override_switch: 0_u8,
19098 };
19099 #[cfg(feature = "arbitrary")]
19100 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19101 use arbitrary::{Arbitrary, Unstructured};
19102 let mut buf = [0u8; 1024];
19103 rng.fill_bytes(&mut buf);
19104 let mut unstructured = Unstructured::new(&buf);
19105 Self::arbitrary(&mut unstructured).unwrap_or_default()
19106 }
19107}
19108impl Default for MANUAL_SETPOINT_DATA {
19109 fn default() -> Self {
19110 Self::DEFAULT.clone()
19111 }
19112}
19113impl MessageData for MANUAL_SETPOINT_DATA {
19114 type Message = MavMessage;
19115 const ID: u32 = 81u32;
19116 const NAME: &'static str = "MANUAL_SETPOINT";
19117 const EXTRA_CRC: u8 = 106u8;
19118 const ENCODED_LEN: usize = 22usize;
19119 fn deser(
19120 _version: MavlinkVersion,
19121 __input: &[u8],
19122 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19123 let avail_len = __input.len();
19124 let mut payload_buf = [0; Self::ENCODED_LEN];
19125 let mut buf = if avail_len < Self::ENCODED_LEN {
19126 payload_buf[0..avail_len].copy_from_slice(__input);
19127 Bytes::new(&payload_buf)
19128 } else {
19129 Bytes::new(__input)
19130 };
19131 let mut __struct = Self::default();
19132 __struct.time_boot_ms = buf.get_u32_le();
19133 __struct.roll = buf.get_f32_le();
19134 __struct.pitch = buf.get_f32_le();
19135 __struct.yaw = buf.get_f32_le();
19136 __struct.thrust = buf.get_f32_le();
19137 __struct.mode_switch = buf.get_u8();
19138 __struct.manual_override_switch = buf.get_u8();
19139 Ok(__struct)
19140 }
19141 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19142 let mut __tmp = BytesMut::new(bytes);
19143 #[allow(clippy::absurd_extreme_comparisons)]
19144 #[allow(unused_comparisons)]
19145 if __tmp.remaining() < Self::ENCODED_LEN {
19146 panic!(
19147 "buffer is too small (need {} bytes, but got {})",
19148 Self::ENCODED_LEN,
19149 __tmp.remaining(),
19150 )
19151 }
19152 __tmp.put_u32_le(self.time_boot_ms);
19153 __tmp.put_f32_le(self.roll);
19154 __tmp.put_f32_le(self.pitch);
19155 __tmp.put_f32_le(self.yaw);
19156 __tmp.put_f32_le(self.thrust);
19157 __tmp.put_u8(self.mode_switch);
19158 __tmp.put_u8(self.manual_override_switch);
19159 if matches!(version, MavlinkVersion::V2) {
19160 let len = __tmp.len();
19161 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19162 } else {
19163 __tmp.len()
19164 }
19165 }
19166}
19167#[doc = "id: 249"]
19168#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19169#[derive(Debug, Clone, PartialEq)]
19170#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19171#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19172pub struct MEMORY_VECT_DATA {
19173 #[doc = "Starting address of the debug variables"]
19174 pub address: u16,
19175 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19176 pub ver: u8,
19177 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19178 pub mavtype: u8,
19179 #[doc = "Memory contents at specified address"]
19180 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19181 pub value: [i8; 32],
19182}
19183impl MEMORY_VECT_DATA {
19184 pub const ENCODED_LEN: usize = 36usize;
19185 pub const DEFAULT: Self = Self {
19186 address: 0_u16,
19187 ver: 0_u8,
19188 mavtype: 0_u8,
19189 value: [0_i8; 32usize],
19190 };
19191 #[cfg(feature = "arbitrary")]
19192 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19193 use arbitrary::{Arbitrary, Unstructured};
19194 let mut buf = [0u8; 1024];
19195 rng.fill_bytes(&mut buf);
19196 let mut unstructured = Unstructured::new(&buf);
19197 Self::arbitrary(&mut unstructured).unwrap_or_default()
19198 }
19199}
19200impl Default for MEMORY_VECT_DATA {
19201 fn default() -> Self {
19202 Self::DEFAULT.clone()
19203 }
19204}
19205impl MessageData for MEMORY_VECT_DATA {
19206 type Message = MavMessage;
19207 const ID: u32 = 249u32;
19208 const NAME: &'static str = "MEMORY_VECT";
19209 const EXTRA_CRC: u8 = 204u8;
19210 const ENCODED_LEN: usize = 36usize;
19211 fn deser(
19212 _version: MavlinkVersion,
19213 __input: &[u8],
19214 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19215 let avail_len = __input.len();
19216 let mut payload_buf = [0; Self::ENCODED_LEN];
19217 let mut buf = if avail_len < Self::ENCODED_LEN {
19218 payload_buf[0..avail_len].copy_from_slice(__input);
19219 Bytes::new(&payload_buf)
19220 } else {
19221 Bytes::new(__input)
19222 };
19223 let mut __struct = Self::default();
19224 __struct.address = buf.get_u16_le();
19225 __struct.ver = buf.get_u8();
19226 __struct.mavtype = buf.get_u8();
19227 for v in &mut __struct.value {
19228 let val = buf.get_i8();
19229 *v = val;
19230 }
19231 Ok(__struct)
19232 }
19233 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19234 let mut __tmp = BytesMut::new(bytes);
19235 #[allow(clippy::absurd_extreme_comparisons)]
19236 #[allow(unused_comparisons)]
19237 if __tmp.remaining() < Self::ENCODED_LEN {
19238 panic!(
19239 "buffer is too small (need {} bytes, but got {})",
19240 Self::ENCODED_LEN,
19241 __tmp.remaining(),
19242 )
19243 }
19244 __tmp.put_u16_le(self.address);
19245 __tmp.put_u8(self.ver);
19246 __tmp.put_u8(self.mavtype);
19247 for val in &self.value {
19248 __tmp.put_i8(*val);
19249 }
19250 if matches!(version, MavlinkVersion::V2) {
19251 let len = __tmp.len();
19252 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19253 } else {
19254 __tmp.len()
19255 }
19256 }
19257}
19258#[doc = "id: 244"]
19259#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19260#[derive(Debug, Clone, PartialEq)]
19261#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19262#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19263pub struct MESSAGE_INTERVAL_DATA {
19264 #[doc = "0 indicates the interval at which it is sent."]
19265 pub interval_us: i32,
19266 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19267 pub message_id: u16,
19268}
19269impl MESSAGE_INTERVAL_DATA {
19270 pub const ENCODED_LEN: usize = 6usize;
19271 pub const DEFAULT: Self = Self {
19272 interval_us: 0_i32,
19273 message_id: 0_u16,
19274 };
19275 #[cfg(feature = "arbitrary")]
19276 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19277 use arbitrary::{Arbitrary, Unstructured};
19278 let mut buf = [0u8; 1024];
19279 rng.fill_bytes(&mut buf);
19280 let mut unstructured = Unstructured::new(&buf);
19281 Self::arbitrary(&mut unstructured).unwrap_or_default()
19282 }
19283}
19284impl Default for MESSAGE_INTERVAL_DATA {
19285 fn default() -> Self {
19286 Self::DEFAULT.clone()
19287 }
19288}
19289impl MessageData for MESSAGE_INTERVAL_DATA {
19290 type Message = MavMessage;
19291 const ID: u32 = 244u32;
19292 const NAME: &'static str = "MESSAGE_INTERVAL";
19293 const EXTRA_CRC: u8 = 95u8;
19294 const ENCODED_LEN: usize = 6usize;
19295 fn deser(
19296 _version: MavlinkVersion,
19297 __input: &[u8],
19298 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19299 let avail_len = __input.len();
19300 let mut payload_buf = [0; Self::ENCODED_LEN];
19301 let mut buf = if avail_len < Self::ENCODED_LEN {
19302 payload_buf[0..avail_len].copy_from_slice(__input);
19303 Bytes::new(&payload_buf)
19304 } else {
19305 Bytes::new(__input)
19306 };
19307 let mut __struct = Self::default();
19308 __struct.interval_us = buf.get_i32_le();
19309 __struct.message_id = buf.get_u16_le();
19310 Ok(__struct)
19311 }
19312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19313 let mut __tmp = BytesMut::new(bytes);
19314 #[allow(clippy::absurd_extreme_comparisons)]
19315 #[allow(unused_comparisons)]
19316 if __tmp.remaining() < Self::ENCODED_LEN {
19317 panic!(
19318 "buffer is too small (need {} bytes, but got {})",
19319 Self::ENCODED_LEN,
19320 __tmp.remaining(),
19321 )
19322 }
19323 __tmp.put_i32_le(self.interval_us);
19324 __tmp.put_u16_le(self.message_id);
19325 if matches!(version, MavlinkVersion::V2) {
19326 let len = __tmp.len();
19327 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19328 } else {
19329 __tmp.len()
19330 }
19331 }
19332}
19333#[doc = "id: 47"]
19334#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19335#[derive(Debug, Clone, PartialEq)]
19336#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19337#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19338pub struct MISSION_ACK_DATA {
19339 #[doc = "System ID"]
19340 pub target_system: u8,
19341 #[doc = "Component ID"]
19342 pub target_component: u8,
19343 #[doc = "Mission result."]
19344 pub mavtype: MavMissionResult,
19345 #[doc = "Mission type."]
19346 #[cfg_attr(feature = "serde", serde(default))]
19347 pub mission_type: MavMissionType,
19348 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19349 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19350 pub opaque_id: u32,
19351}
19352impl MISSION_ACK_DATA {
19353 pub const ENCODED_LEN: usize = 8usize;
19354 pub const DEFAULT: Self = Self {
19355 target_system: 0_u8,
19356 target_component: 0_u8,
19357 mavtype: MavMissionResult::DEFAULT,
19358 mission_type: MavMissionType::DEFAULT,
19359 opaque_id: 0_u32,
19360 };
19361 #[cfg(feature = "arbitrary")]
19362 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19363 use arbitrary::{Arbitrary, Unstructured};
19364 let mut buf = [0u8; 1024];
19365 rng.fill_bytes(&mut buf);
19366 let mut unstructured = Unstructured::new(&buf);
19367 Self::arbitrary(&mut unstructured).unwrap_or_default()
19368 }
19369}
19370impl Default for MISSION_ACK_DATA {
19371 fn default() -> Self {
19372 Self::DEFAULT.clone()
19373 }
19374}
19375impl MessageData for MISSION_ACK_DATA {
19376 type Message = MavMessage;
19377 const ID: u32 = 47u32;
19378 const NAME: &'static str = "MISSION_ACK";
19379 const EXTRA_CRC: u8 = 153u8;
19380 const ENCODED_LEN: usize = 8usize;
19381 fn deser(
19382 _version: MavlinkVersion,
19383 __input: &[u8],
19384 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19385 let avail_len = __input.len();
19386 let mut payload_buf = [0; Self::ENCODED_LEN];
19387 let mut buf = if avail_len < Self::ENCODED_LEN {
19388 payload_buf[0..avail_len].copy_from_slice(__input);
19389 Bytes::new(&payload_buf)
19390 } else {
19391 Bytes::new(__input)
19392 };
19393 let mut __struct = Self::default();
19394 __struct.target_system = buf.get_u8();
19395 __struct.target_component = buf.get_u8();
19396 let tmp = buf.get_u8();
19397 __struct.mavtype =
19398 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19399 enum_type: "MavMissionResult",
19400 value: tmp as u32,
19401 })?;
19402 let tmp = buf.get_u8();
19403 __struct.mission_type =
19404 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19405 enum_type: "MavMissionType",
19406 value: tmp as u32,
19407 })?;
19408 __struct.opaque_id = buf.get_u32_le();
19409 Ok(__struct)
19410 }
19411 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19412 let mut __tmp = BytesMut::new(bytes);
19413 #[allow(clippy::absurd_extreme_comparisons)]
19414 #[allow(unused_comparisons)]
19415 if __tmp.remaining() < Self::ENCODED_LEN {
19416 panic!(
19417 "buffer is too small (need {} bytes, but got {})",
19418 Self::ENCODED_LEN,
19419 __tmp.remaining(),
19420 )
19421 }
19422 __tmp.put_u8(self.target_system);
19423 __tmp.put_u8(self.target_component);
19424 __tmp.put_u8(self.mavtype as u8);
19425 __tmp.put_u8(self.mission_type as u8);
19426 __tmp.put_u32_le(self.opaque_id);
19427 if matches!(version, MavlinkVersion::V2) {
19428 let len = __tmp.len();
19429 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19430 } else {
19431 __tmp.len()
19432 }
19433 }
19434}
19435#[doc = "id: 45"]
19436#[doc = "Delete all mission items at once."]
19437#[derive(Debug, Clone, PartialEq)]
19438#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19439#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19440pub struct MISSION_CLEAR_ALL_DATA {
19441 #[doc = "System ID"]
19442 pub target_system: u8,
19443 #[doc = "Component ID"]
19444 pub target_component: u8,
19445 #[doc = "Mission type."]
19446 #[cfg_attr(feature = "serde", serde(default))]
19447 pub mission_type: MavMissionType,
19448}
19449impl MISSION_CLEAR_ALL_DATA {
19450 pub const ENCODED_LEN: usize = 3usize;
19451 pub const DEFAULT: Self = Self {
19452 target_system: 0_u8,
19453 target_component: 0_u8,
19454 mission_type: MavMissionType::DEFAULT,
19455 };
19456 #[cfg(feature = "arbitrary")]
19457 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19458 use arbitrary::{Arbitrary, Unstructured};
19459 let mut buf = [0u8; 1024];
19460 rng.fill_bytes(&mut buf);
19461 let mut unstructured = Unstructured::new(&buf);
19462 Self::arbitrary(&mut unstructured).unwrap_or_default()
19463 }
19464}
19465impl Default for MISSION_CLEAR_ALL_DATA {
19466 fn default() -> Self {
19467 Self::DEFAULT.clone()
19468 }
19469}
19470impl MessageData for MISSION_CLEAR_ALL_DATA {
19471 type Message = MavMessage;
19472 const ID: u32 = 45u32;
19473 const NAME: &'static str = "MISSION_CLEAR_ALL";
19474 const EXTRA_CRC: u8 = 232u8;
19475 const ENCODED_LEN: usize = 3usize;
19476 fn deser(
19477 _version: MavlinkVersion,
19478 __input: &[u8],
19479 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19480 let avail_len = __input.len();
19481 let mut payload_buf = [0; Self::ENCODED_LEN];
19482 let mut buf = if avail_len < Self::ENCODED_LEN {
19483 payload_buf[0..avail_len].copy_from_slice(__input);
19484 Bytes::new(&payload_buf)
19485 } else {
19486 Bytes::new(__input)
19487 };
19488 let mut __struct = Self::default();
19489 __struct.target_system = buf.get_u8();
19490 __struct.target_component = buf.get_u8();
19491 let tmp = buf.get_u8();
19492 __struct.mission_type =
19493 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19494 enum_type: "MavMissionType",
19495 value: tmp as u32,
19496 })?;
19497 Ok(__struct)
19498 }
19499 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19500 let mut __tmp = BytesMut::new(bytes);
19501 #[allow(clippy::absurd_extreme_comparisons)]
19502 #[allow(unused_comparisons)]
19503 if __tmp.remaining() < Self::ENCODED_LEN {
19504 panic!(
19505 "buffer is too small (need {} bytes, but got {})",
19506 Self::ENCODED_LEN,
19507 __tmp.remaining(),
19508 )
19509 }
19510 __tmp.put_u8(self.target_system);
19511 __tmp.put_u8(self.target_component);
19512 __tmp.put_u8(self.mission_type as u8);
19513 if matches!(version, MavlinkVersion::V2) {
19514 let len = __tmp.len();
19515 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19516 } else {
19517 __tmp.len()
19518 }
19519 }
19520}
19521#[doc = "id: 44"]
19522#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19523#[derive(Debug, Clone, PartialEq)]
19524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19525#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19526pub struct MISSION_COUNT_DATA {
19527 #[doc = "Number of mission items in the sequence"]
19528 pub count: u16,
19529 #[doc = "System ID"]
19530 pub target_system: u8,
19531 #[doc = "Component ID"]
19532 pub target_component: u8,
19533 #[doc = "Mission type."]
19534 #[cfg_attr(feature = "serde", serde(default))]
19535 pub mission_type: MavMissionType,
19536 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19537 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19538 pub opaque_id: u32,
19539}
19540impl MISSION_COUNT_DATA {
19541 pub const ENCODED_LEN: usize = 9usize;
19542 pub const DEFAULT: Self = Self {
19543 count: 0_u16,
19544 target_system: 0_u8,
19545 target_component: 0_u8,
19546 mission_type: MavMissionType::DEFAULT,
19547 opaque_id: 0_u32,
19548 };
19549 #[cfg(feature = "arbitrary")]
19550 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19551 use arbitrary::{Arbitrary, Unstructured};
19552 let mut buf = [0u8; 1024];
19553 rng.fill_bytes(&mut buf);
19554 let mut unstructured = Unstructured::new(&buf);
19555 Self::arbitrary(&mut unstructured).unwrap_or_default()
19556 }
19557}
19558impl Default for MISSION_COUNT_DATA {
19559 fn default() -> Self {
19560 Self::DEFAULT.clone()
19561 }
19562}
19563impl MessageData for MISSION_COUNT_DATA {
19564 type Message = MavMessage;
19565 const ID: u32 = 44u32;
19566 const NAME: &'static str = "MISSION_COUNT";
19567 const EXTRA_CRC: u8 = 221u8;
19568 const ENCODED_LEN: usize = 9usize;
19569 fn deser(
19570 _version: MavlinkVersion,
19571 __input: &[u8],
19572 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19573 let avail_len = __input.len();
19574 let mut payload_buf = [0; Self::ENCODED_LEN];
19575 let mut buf = if avail_len < Self::ENCODED_LEN {
19576 payload_buf[0..avail_len].copy_from_slice(__input);
19577 Bytes::new(&payload_buf)
19578 } else {
19579 Bytes::new(__input)
19580 };
19581 let mut __struct = Self::default();
19582 __struct.count = buf.get_u16_le();
19583 __struct.target_system = buf.get_u8();
19584 __struct.target_component = buf.get_u8();
19585 let tmp = buf.get_u8();
19586 __struct.mission_type =
19587 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19588 enum_type: "MavMissionType",
19589 value: tmp as u32,
19590 })?;
19591 __struct.opaque_id = buf.get_u32_le();
19592 Ok(__struct)
19593 }
19594 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19595 let mut __tmp = BytesMut::new(bytes);
19596 #[allow(clippy::absurd_extreme_comparisons)]
19597 #[allow(unused_comparisons)]
19598 if __tmp.remaining() < Self::ENCODED_LEN {
19599 panic!(
19600 "buffer is too small (need {} bytes, but got {})",
19601 Self::ENCODED_LEN,
19602 __tmp.remaining(),
19603 )
19604 }
19605 __tmp.put_u16_le(self.count);
19606 __tmp.put_u8(self.target_system);
19607 __tmp.put_u8(self.target_component);
19608 __tmp.put_u8(self.mission_type as u8);
19609 __tmp.put_u32_le(self.opaque_id);
19610 if matches!(version, MavlinkVersion::V2) {
19611 let len = __tmp.len();
19612 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19613 } else {
19614 __tmp.len()
19615 }
19616 }
19617}
19618#[doc = "id: 42"]
19619#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19620#[derive(Debug, Clone, PartialEq)]
19621#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19623pub struct MISSION_CURRENT_DATA {
19624 #[doc = "Sequence"]
19625 pub seq: u16,
19626 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19627 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19628 pub total: u16,
19629 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19630 #[cfg_attr(feature = "serde", serde(default))]
19631 pub mission_state: MissionState,
19632 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19633 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19634 pub mission_mode: u8,
19635 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19636 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19637 pub mission_id: u32,
19638 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19639 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19640 pub fence_id: u32,
19641 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19642 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19643 pub rally_points_id: u32,
19644}
19645impl MISSION_CURRENT_DATA {
19646 pub const ENCODED_LEN: usize = 18usize;
19647 pub const DEFAULT: Self = Self {
19648 seq: 0_u16,
19649 total: 0_u16,
19650 mission_state: MissionState::DEFAULT,
19651 mission_mode: 0_u8,
19652 mission_id: 0_u32,
19653 fence_id: 0_u32,
19654 rally_points_id: 0_u32,
19655 };
19656 #[cfg(feature = "arbitrary")]
19657 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19658 use arbitrary::{Arbitrary, Unstructured};
19659 let mut buf = [0u8; 1024];
19660 rng.fill_bytes(&mut buf);
19661 let mut unstructured = Unstructured::new(&buf);
19662 Self::arbitrary(&mut unstructured).unwrap_or_default()
19663 }
19664}
19665impl Default for MISSION_CURRENT_DATA {
19666 fn default() -> Self {
19667 Self::DEFAULT.clone()
19668 }
19669}
19670impl MessageData for MISSION_CURRENT_DATA {
19671 type Message = MavMessage;
19672 const ID: u32 = 42u32;
19673 const NAME: &'static str = "MISSION_CURRENT";
19674 const EXTRA_CRC: u8 = 28u8;
19675 const ENCODED_LEN: usize = 18usize;
19676 fn deser(
19677 _version: MavlinkVersion,
19678 __input: &[u8],
19679 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19680 let avail_len = __input.len();
19681 let mut payload_buf = [0; Self::ENCODED_LEN];
19682 let mut buf = if avail_len < Self::ENCODED_LEN {
19683 payload_buf[0..avail_len].copy_from_slice(__input);
19684 Bytes::new(&payload_buf)
19685 } else {
19686 Bytes::new(__input)
19687 };
19688 let mut __struct = Self::default();
19689 __struct.seq = buf.get_u16_le();
19690 __struct.total = buf.get_u16_le();
19691 let tmp = buf.get_u8();
19692 __struct.mission_state =
19693 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19694 enum_type: "MissionState",
19695 value: tmp as u32,
19696 })?;
19697 __struct.mission_mode = buf.get_u8();
19698 __struct.mission_id = buf.get_u32_le();
19699 __struct.fence_id = buf.get_u32_le();
19700 __struct.rally_points_id = buf.get_u32_le();
19701 Ok(__struct)
19702 }
19703 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19704 let mut __tmp = BytesMut::new(bytes);
19705 #[allow(clippy::absurd_extreme_comparisons)]
19706 #[allow(unused_comparisons)]
19707 if __tmp.remaining() < Self::ENCODED_LEN {
19708 panic!(
19709 "buffer is too small (need {} bytes, but got {})",
19710 Self::ENCODED_LEN,
19711 __tmp.remaining(),
19712 )
19713 }
19714 __tmp.put_u16_le(self.seq);
19715 __tmp.put_u16_le(self.total);
19716 __tmp.put_u8(self.mission_state as u8);
19717 __tmp.put_u8(self.mission_mode);
19718 __tmp.put_u32_le(self.mission_id);
19719 __tmp.put_u32_le(self.fence_id);
19720 __tmp.put_u32_le(self.rally_points_id);
19721 if matches!(version, MavlinkVersion::V2) {
19722 let len = __tmp.len();
19723 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19724 } else {
19725 __tmp.len()
19726 }
19727 }
19728}
19729#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19730#[doc = "id: 39"]
19731#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19732#[derive(Debug, Clone, PartialEq)]
19733#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19734#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19735pub struct MISSION_ITEM_DATA {
19736 #[doc = "PARAM1, see MAV_CMD enum"]
19737 pub param1: f32,
19738 #[doc = "PARAM2, see MAV_CMD enum"]
19739 pub param2: f32,
19740 #[doc = "PARAM3, see MAV_CMD enum"]
19741 pub param3: f32,
19742 #[doc = "PARAM4, see MAV_CMD enum"]
19743 pub param4: f32,
19744 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19745 pub x: f32,
19746 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19747 pub y: f32,
19748 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19749 pub z: f32,
19750 #[doc = "Sequence"]
19751 pub seq: u16,
19752 #[doc = "The scheduled action for the waypoint."]
19753 pub command: MavCmd,
19754 #[doc = "System ID"]
19755 pub target_system: u8,
19756 #[doc = "Component ID"]
19757 pub target_component: u8,
19758 #[doc = "The coordinate system of the waypoint."]
19759 pub frame: MavFrame,
19760 #[doc = "false:0, true:1"]
19761 pub current: u8,
19762 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19763 pub autocontinue: u8,
19764 #[doc = "Mission type."]
19765 #[cfg_attr(feature = "serde", serde(default))]
19766 pub mission_type: MavMissionType,
19767}
19768impl MISSION_ITEM_DATA {
19769 pub const ENCODED_LEN: usize = 38usize;
19770 pub const DEFAULT: Self = Self {
19771 param1: 0.0_f32,
19772 param2: 0.0_f32,
19773 param3: 0.0_f32,
19774 param4: 0.0_f32,
19775 x: 0.0_f32,
19776 y: 0.0_f32,
19777 z: 0.0_f32,
19778 seq: 0_u16,
19779 command: MavCmd::DEFAULT,
19780 target_system: 0_u8,
19781 target_component: 0_u8,
19782 frame: MavFrame::DEFAULT,
19783 current: 0_u8,
19784 autocontinue: 0_u8,
19785 mission_type: MavMissionType::DEFAULT,
19786 };
19787 #[cfg(feature = "arbitrary")]
19788 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19789 use arbitrary::{Arbitrary, Unstructured};
19790 let mut buf = [0u8; 1024];
19791 rng.fill_bytes(&mut buf);
19792 let mut unstructured = Unstructured::new(&buf);
19793 Self::arbitrary(&mut unstructured).unwrap_or_default()
19794 }
19795}
19796impl Default for MISSION_ITEM_DATA {
19797 fn default() -> Self {
19798 Self::DEFAULT.clone()
19799 }
19800}
19801impl MessageData for MISSION_ITEM_DATA {
19802 type Message = MavMessage;
19803 const ID: u32 = 39u32;
19804 const NAME: &'static str = "MISSION_ITEM";
19805 const EXTRA_CRC: u8 = 254u8;
19806 const ENCODED_LEN: usize = 38usize;
19807 fn deser(
19808 _version: MavlinkVersion,
19809 __input: &[u8],
19810 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19811 let avail_len = __input.len();
19812 let mut payload_buf = [0; Self::ENCODED_LEN];
19813 let mut buf = if avail_len < Self::ENCODED_LEN {
19814 payload_buf[0..avail_len].copy_from_slice(__input);
19815 Bytes::new(&payload_buf)
19816 } else {
19817 Bytes::new(__input)
19818 };
19819 let mut __struct = Self::default();
19820 __struct.param1 = buf.get_f32_le();
19821 __struct.param2 = buf.get_f32_le();
19822 __struct.param3 = buf.get_f32_le();
19823 __struct.param4 = buf.get_f32_le();
19824 __struct.x = buf.get_f32_le();
19825 __struct.y = buf.get_f32_le();
19826 __struct.z = buf.get_f32_le();
19827 __struct.seq = buf.get_u16_le();
19828 let tmp = buf.get_u16_le();
19829 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19830 ::mavlink_core::error::ParserError::InvalidEnum {
19831 enum_type: "MavCmd",
19832 value: tmp as u32,
19833 },
19834 )?;
19835 __struct.target_system = buf.get_u8();
19836 __struct.target_component = buf.get_u8();
19837 let tmp = buf.get_u8();
19838 __struct.frame =
19839 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19840 enum_type: "MavFrame",
19841 value: tmp as u32,
19842 })?;
19843 __struct.current = buf.get_u8();
19844 __struct.autocontinue = buf.get_u8();
19845 let tmp = buf.get_u8();
19846 __struct.mission_type =
19847 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19848 enum_type: "MavMissionType",
19849 value: tmp as u32,
19850 })?;
19851 Ok(__struct)
19852 }
19853 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19854 let mut __tmp = BytesMut::new(bytes);
19855 #[allow(clippy::absurd_extreme_comparisons)]
19856 #[allow(unused_comparisons)]
19857 if __tmp.remaining() < Self::ENCODED_LEN {
19858 panic!(
19859 "buffer is too small (need {} bytes, but got {})",
19860 Self::ENCODED_LEN,
19861 __tmp.remaining(),
19862 )
19863 }
19864 __tmp.put_f32_le(self.param1);
19865 __tmp.put_f32_le(self.param2);
19866 __tmp.put_f32_le(self.param3);
19867 __tmp.put_f32_le(self.param4);
19868 __tmp.put_f32_le(self.x);
19869 __tmp.put_f32_le(self.y);
19870 __tmp.put_f32_le(self.z);
19871 __tmp.put_u16_le(self.seq);
19872 __tmp.put_u16_le(self.command as u16);
19873 __tmp.put_u8(self.target_system);
19874 __tmp.put_u8(self.target_component);
19875 __tmp.put_u8(self.frame as u8);
19876 __tmp.put_u8(self.current);
19877 __tmp.put_u8(self.autocontinue);
19878 __tmp.put_u8(self.mission_type as u8);
19879 if matches!(version, MavlinkVersion::V2) {
19880 let len = __tmp.len();
19881 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19882 } else {
19883 __tmp.len()
19884 }
19885 }
19886}
19887#[doc = "id: 73"]
19888#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19889#[derive(Debug, Clone, PartialEq)]
19890#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19891#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19892pub struct MISSION_ITEM_INT_DATA {
19893 #[doc = "PARAM1, see MAV_CMD enum"]
19894 pub param1: f32,
19895 #[doc = "PARAM2, see MAV_CMD enum"]
19896 pub param2: f32,
19897 #[doc = "PARAM3, see MAV_CMD enum"]
19898 pub param3: f32,
19899 #[doc = "PARAM4, see MAV_CMD enum"]
19900 pub param4: f32,
19901 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19902 pub x: i32,
19903 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19904 pub y: i32,
19905 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19906 pub z: f32,
19907 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19908 pub seq: u16,
19909 #[doc = "The scheduled action for the waypoint."]
19910 pub command: MavCmd,
19911 #[doc = "System ID"]
19912 pub target_system: u8,
19913 #[doc = "Component ID"]
19914 pub target_component: u8,
19915 #[doc = "The coordinate system of the waypoint."]
19916 pub frame: MavFrame,
19917 #[doc = "false:0, true:1"]
19918 pub current: u8,
19919 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19920 pub autocontinue: u8,
19921 #[doc = "Mission type."]
19922 #[cfg_attr(feature = "serde", serde(default))]
19923 pub mission_type: MavMissionType,
19924}
19925impl MISSION_ITEM_INT_DATA {
19926 pub const ENCODED_LEN: usize = 38usize;
19927 pub const DEFAULT: Self = Self {
19928 param1: 0.0_f32,
19929 param2: 0.0_f32,
19930 param3: 0.0_f32,
19931 param4: 0.0_f32,
19932 x: 0_i32,
19933 y: 0_i32,
19934 z: 0.0_f32,
19935 seq: 0_u16,
19936 command: MavCmd::DEFAULT,
19937 target_system: 0_u8,
19938 target_component: 0_u8,
19939 frame: MavFrame::DEFAULT,
19940 current: 0_u8,
19941 autocontinue: 0_u8,
19942 mission_type: MavMissionType::DEFAULT,
19943 };
19944 #[cfg(feature = "arbitrary")]
19945 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19946 use arbitrary::{Arbitrary, Unstructured};
19947 let mut buf = [0u8; 1024];
19948 rng.fill_bytes(&mut buf);
19949 let mut unstructured = Unstructured::new(&buf);
19950 Self::arbitrary(&mut unstructured).unwrap_or_default()
19951 }
19952}
19953impl Default for MISSION_ITEM_INT_DATA {
19954 fn default() -> Self {
19955 Self::DEFAULT.clone()
19956 }
19957}
19958impl MessageData for MISSION_ITEM_INT_DATA {
19959 type Message = MavMessage;
19960 const ID: u32 = 73u32;
19961 const NAME: &'static str = "MISSION_ITEM_INT";
19962 const EXTRA_CRC: u8 = 38u8;
19963 const ENCODED_LEN: usize = 38usize;
19964 fn deser(
19965 _version: MavlinkVersion,
19966 __input: &[u8],
19967 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19968 let avail_len = __input.len();
19969 let mut payload_buf = [0; Self::ENCODED_LEN];
19970 let mut buf = if avail_len < Self::ENCODED_LEN {
19971 payload_buf[0..avail_len].copy_from_slice(__input);
19972 Bytes::new(&payload_buf)
19973 } else {
19974 Bytes::new(__input)
19975 };
19976 let mut __struct = Self::default();
19977 __struct.param1 = buf.get_f32_le();
19978 __struct.param2 = buf.get_f32_le();
19979 __struct.param3 = buf.get_f32_le();
19980 __struct.param4 = buf.get_f32_le();
19981 __struct.x = buf.get_i32_le();
19982 __struct.y = buf.get_i32_le();
19983 __struct.z = buf.get_f32_le();
19984 __struct.seq = buf.get_u16_le();
19985 let tmp = buf.get_u16_le();
19986 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19987 ::mavlink_core::error::ParserError::InvalidEnum {
19988 enum_type: "MavCmd",
19989 value: tmp as u32,
19990 },
19991 )?;
19992 __struct.target_system = buf.get_u8();
19993 __struct.target_component = buf.get_u8();
19994 let tmp = buf.get_u8();
19995 __struct.frame =
19996 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19997 enum_type: "MavFrame",
19998 value: tmp as u32,
19999 })?;
20000 __struct.current = buf.get_u8();
20001 __struct.autocontinue = buf.get_u8();
20002 let tmp = buf.get_u8();
20003 __struct.mission_type =
20004 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20005 enum_type: "MavMissionType",
20006 value: tmp as u32,
20007 })?;
20008 Ok(__struct)
20009 }
20010 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20011 let mut __tmp = BytesMut::new(bytes);
20012 #[allow(clippy::absurd_extreme_comparisons)]
20013 #[allow(unused_comparisons)]
20014 if __tmp.remaining() < Self::ENCODED_LEN {
20015 panic!(
20016 "buffer is too small (need {} bytes, but got {})",
20017 Self::ENCODED_LEN,
20018 __tmp.remaining(),
20019 )
20020 }
20021 __tmp.put_f32_le(self.param1);
20022 __tmp.put_f32_le(self.param2);
20023 __tmp.put_f32_le(self.param3);
20024 __tmp.put_f32_le(self.param4);
20025 __tmp.put_i32_le(self.x);
20026 __tmp.put_i32_le(self.y);
20027 __tmp.put_f32_le(self.z);
20028 __tmp.put_u16_le(self.seq);
20029 __tmp.put_u16_le(self.command as u16);
20030 __tmp.put_u8(self.target_system);
20031 __tmp.put_u8(self.target_component);
20032 __tmp.put_u8(self.frame as u8);
20033 __tmp.put_u8(self.current);
20034 __tmp.put_u8(self.autocontinue);
20035 __tmp.put_u8(self.mission_type as u8);
20036 if matches!(version, MavlinkVersion::V2) {
20037 let len = __tmp.len();
20038 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20039 } else {
20040 __tmp.len()
20041 }
20042 }
20043}
20044#[doc = "id: 46"]
20045#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20046#[derive(Debug, Clone, PartialEq)]
20047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20049pub struct MISSION_ITEM_REACHED_DATA {
20050 #[doc = "Sequence"]
20051 pub seq: u16,
20052}
20053impl MISSION_ITEM_REACHED_DATA {
20054 pub const ENCODED_LEN: usize = 2usize;
20055 pub const DEFAULT: Self = Self { seq: 0_u16 };
20056 #[cfg(feature = "arbitrary")]
20057 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20058 use arbitrary::{Arbitrary, Unstructured};
20059 let mut buf = [0u8; 1024];
20060 rng.fill_bytes(&mut buf);
20061 let mut unstructured = Unstructured::new(&buf);
20062 Self::arbitrary(&mut unstructured).unwrap_or_default()
20063 }
20064}
20065impl Default for MISSION_ITEM_REACHED_DATA {
20066 fn default() -> Self {
20067 Self::DEFAULT.clone()
20068 }
20069}
20070impl MessageData for MISSION_ITEM_REACHED_DATA {
20071 type Message = MavMessage;
20072 const ID: u32 = 46u32;
20073 const NAME: &'static str = "MISSION_ITEM_REACHED";
20074 const EXTRA_CRC: u8 = 11u8;
20075 const ENCODED_LEN: usize = 2usize;
20076 fn deser(
20077 _version: MavlinkVersion,
20078 __input: &[u8],
20079 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20080 let avail_len = __input.len();
20081 let mut payload_buf = [0; Self::ENCODED_LEN];
20082 let mut buf = if avail_len < Self::ENCODED_LEN {
20083 payload_buf[0..avail_len].copy_from_slice(__input);
20084 Bytes::new(&payload_buf)
20085 } else {
20086 Bytes::new(__input)
20087 };
20088 let mut __struct = Self::default();
20089 __struct.seq = buf.get_u16_le();
20090 Ok(__struct)
20091 }
20092 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20093 let mut __tmp = BytesMut::new(bytes);
20094 #[allow(clippy::absurd_extreme_comparisons)]
20095 #[allow(unused_comparisons)]
20096 if __tmp.remaining() < Self::ENCODED_LEN {
20097 panic!(
20098 "buffer is too small (need {} bytes, but got {})",
20099 Self::ENCODED_LEN,
20100 __tmp.remaining(),
20101 )
20102 }
20103 __tmp.put_u16_le(self.seq);
20104 if matches!(version, MavlinkVersion::V2) {
20105 let len = __tmp.len();
20106 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20107 } else {
20108 __tmp.len()
20109 }
20110 }
20111}
20112#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20113#[doc = "id: 40"]
20114#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20115#[derive(Debug, Clone, PartialEq)]
20116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20118pub struct MISSION_REQUEST_DATA {
20119 #[doc = "Sequence"]
20120 pub seq: u16,
20121 #[doc = "System ID"]
20122 pub target_system: u8,
20123 #[doc = "Component ID"]
20124 pub target_component: u8,
20125 #[doc = "Mission type."]
20126 #[cfg_attr(feature = "serde", serde(default))]
20127 pub mission_type: MavMissionType,
20128}
20129impl MISSION_REQUEST_DATA {
20130 pub const ENCODED_LEN: usize = 5usize;
20131 pub const DEFAULT: Self = Self {
20132 seq: 0_u16,
20133 target_system: 0_u8,
20134 target_component: 0_u8,
20135 mission_type: MavMissionType::DEFAULT,
20136 };
20137 #[cfg(feature = "arbitrary")]
20138 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20139 use arbitrary::{Arbitrary, Unstructured};
20140 let mut buf = [0u8; 1024];
20141 rng.fill_bytes(&mut buf);
20142 let mut unstructured = Unstructured::new(&buf);
20143 Self::arbitrary(&mut unstructured).unwrap_or_default()
20144 }
20145}
20146impl Default for MISSION_REQUEST_DATA {
20147 fn default() -> Self {
20148 Self::DEFAULT.clone()
20149 }
20150}
20151impl MessageData for MISSION_REQUEST_DATA {
20152 type Message = MavMessage;
20153 const ID: u32 = 40u32;
20154 const NAME: &'static str = "MISSION_REQUEST";
20155 const EXTRA_CRC: u8 = 230u8;
20156 const ENCODED_LEN: usize = 5usize;
20157 fn deser(
20158 _version: MavlinkVersion,
20159 __input: &[u8],
20160 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20161 let avail_len = __input.len();
20162 let mut payload_buf = [0; Self::ENCODED_LEN];
20163 let mut buf = if avail_len < Self::ENCODED_LEN {
20164 payload_buf[0..avail_len].copy_from_slice(__input);
20165 Bytes::new(&payload_buf)
20166 } else {
20167 Bytes::new(__input)
20168 };
20169 let mut __struct = Self::default();
20170 __struct.seq = buf.get_u16_le();
20171 __struct.target_system = buf.get_u8();
20172 __struct.target_component = buf.get_u8();
20173 let tmp = buf.get_u8();
20174 __struct.mission_type =
20175 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20176 enum_type: "MavMissionType",
20177 value: tmp as u32,
20178 })?;
20179 Ok(__struct)
20180 }
20181 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20182 let mut __tmp = BytesMut::new(bytes);
20183 #[allow(clippy::absurd_extreme_comparisons)]
20184 #[allow(unused_comparisons)]
20185 if __tmp.remaining() < Self::ENCODED_LEN {
20186 panic!(
20187 "buffer is too small (need {} bytes, but got {})",
20188 Self::ENCODED_LEN,
20189 __tmp.remaining(),
20190 )
20191 }
20192 __tmp.put_u16_le(self.seq);
20193 __tmp.put_u8(self.target_system);
20194 __tmp.put_u8(self.target_component);
20195 __tmp.put_u8(self.mission_type as u8);
20196 if matches!(version, MavlinkVersion::V2) {
20197 let len = __tmp.len();
20198 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20199 } else {
20200 __tmp.len()
20201 }
20202 }
20203}
20204#[doc = "id: 51"]
20205#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20206#[derive(Debug, Clone, PartialEq)]
20207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20209pub struct MISSION_REQUEST_INT_DATA {
20210 #[doc = "Sequence"]
20211 pub seq: u16,
20212 #[doc = "System ID"]
20213 pub target_system: u8,
20214 #[doc = "Component ID"]
20215 pub target_component: u8,
20216 #[doc = "Mission type."]
20217 #[cfg_attr(feature = "serde", serde(default))]
20218 pub mission_type: MavMissionType,
20219}
20220impl MISSION_REQUEST_INT_DATA {
20221 pub const ENCODED_LEN: usize = 5usize;
20222 pub const DEFAULT: Self = Self {
20223 seq: 0_u16,
20224 target_system: 0_u8,
20225 target_component: 0_u8,
20226 mission_type: MavMissionType::DEFAULT,
20227 };
20228 #[cfg(feature = "arbitrary")]
20229 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20230 use arbitrary::{Arbitrary, Unstructured};
20231 let mut buf = [0u8; 1024];
20232 rng.fill_bytes(&mut buf);
20233 let mut unstructured = Unstructured::new(&buf);
20234 Self::arbitrary(&mut unstructured).unwrap_or_default()
20235 }
20236}
20237impl Default for MISSION_REQUEST_INT_DATA {
20238 fn default() -> Self {
20239 Self::DEFAULT.clone()
20240 }
20241}
20242impl MessageData for MISSION_REQUEST_INT_DATA {
20243 type Message = MavMessage;
20244 const ID: u32 = 51u32;
20245 const NAME: &'static str = "MISSION_REQUEST_INT";
20246 const EXTRA_CRC: u8 = 196u8;
20247 const ENCODED_LEN: usize = 5usize;
20248 fn deser(
20249 _version: MavlinkVersion,
20250 __input: &[u8],
20251 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20252 let avail_len = __input.len();
20253 let mut payload_buf = [0; Self::ENCODED_LEN];
20254 let mut buf = if avail_len < Self::ENCODED_LEN {
20255 payload_buf[0..avail_len].copy_from_slice(__input);
20256 Bytes::new(&payload_buf)
20257 } else {
20258 Bytes::new(__input)
20259 };
20260 let mut __struct = Self::default();
20261 __struct.seq = buf.get_u16_le();
20262 __struct.target_system = buf.get_u8();
20263 __struct.target_component = buf.get_u8();
20264 let tmp = buf.get_u8();
20265 __struct.mission_type =
20266 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20267 enum_type: "MavMissionType",
20268 value: tmp as u32,
20269 })?;
20270 Ok(__struct)
20271 }
20272 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20273 let mut __tmp = BytesMut::new(bytes);
20274 #[allow(clippy::absurd_extreme_comparisons)]
20275 #[allow(unused_comparisons)]
20276 if __tmp.remaining() < Self::ENCODED_LEN {
20277 panic!(
20278 "buffer is too small (need {} bytes, but got {})",
20279 Self::ENCODED_LEN,
20280 __tmp.remaining(),
20281 )
20282 }
20283 __tmp.put_u16_le(self.seq);
20284 __tmp.put_u8(self.target_system);
20285 __tmp.put_u8(self.target_component);
20286 __tmp.put_u8(self.mission_type as u8);
20287 if matches!(version, MavlinkVersion::V2) {
20288 let len = __tmp.len();
20289 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20290 } else {
20291 __tmp.len()
20292 }
20293 }
20294}
20295#[doc = "id: 43"]
20296#[doc = "Request the overall list of mission items from the system/component."]
20297#[derive(Debug, Clone, PartialEq)]
20298#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20299#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20300pub struct MISSION_REQUEST_LIST_DATA {
20301 #[doc = "System ID"]
20302 pub target_system: u8,
20303 #[doc = "Component ID"]
20304 pub target_component: u8,
20305 #[doc = "Mission type."]
20306 #[cfg_attr(feature = "serde", serde(default))]
20307 pub mission_type: MavMissionType,
20308}
20309impl MISSION_REQUEST_LIST_DATA {
20310 pub const ENCODED_LEN: usize = 3usize;
20311 pub const DEFAULT: Self = Self {
20312 target_system: 0_u8,
20313 target_component: 0_u8,
20314 mission_type: MavMissionType::DEFAULT,
20315 };
20316 #[cfg(feature = "arbitrary")]
20317 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20318 use arbitrary::{Arbitrary, Unstructured};
20319 let mut buf = [0u8; 1024];
20320 rng.fill_bytes(&mut buf);
20321 let mut unstructured = Unstructured::new(&buf);
20322 Self::arbitrary(&mut unstructured).unwrap_or_default()
20323 }
20324}
20325impl Default for MISSION_REQUEST_LIST_DATA {
20326 fn default() -> Self {
20327 Self::DEFAULT.clone()
20328 }
20329}
20330impl MessageData for MISSION_REQUEST_LIST_DATA {
20331 type Message = MavMessage;
20332 const ID: u32 = 43u32;
20333 const NAME: &'static str = "MISSION_REQUEST_LIST";
20334 const EXTRA_CRC: u8 = 132u8;
20335 const ENCODED_LEN: usize = 3usize;
20336 fn deser(
20337 _version: MavlinkVersion,
20338 __input: &[u8],
20339 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20340 let avail_len = __input.len();
20341 let mut payload_buf = [0; Self::ENCODED_LEN];
20342 let mut buf = if avail_len < Self::ENCODED_LEN {
20343 payload_buf[0..avail_len].copy_from_slice(__input);
20344 Bytes::new(&payload_buf)
20345 } else {
20346 Bytes::new(__input)
20347 };
20348 let mut __struct = Self::default();
20349 __struct.target_system = buf.get_u8();
20350 __struct.target_component = buf.get_u8();
20351 let tmp = buf.get_u8();
20352 __struct.mission_type =
20353 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20354 enum_type: "MavMissionType",
20355 value: tmp as u32,
20356 })?;
20357 Ok(__struct)
20358 }
20359 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20360 let mut __tmp = BytesMut::new(bytes);
20361 #[allow(clippy::absurd_extreme_comparisons)]
20362 #[allow(unused_comparisons)]
20363 if __tmp.remaining() < Self::ENCODED_LEN {
20364 panic!(
20365 "buffer is too small (need {} bytes, but got {})",
20366 Self::ENCODED_LEN,
20367 __tmp.remaining(),
20368 )
20369 }
20370 __tmp.put_u8(self.target_system);
20371 __tmp.put_u8(self.target_component);
20372 __tmp.put_u8(self.mission_type as u8);
20373 if matches!(version, MavlinkVersion::V2) {
20374 let len = __tmp.len();
20375 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20376 } else {
20377 __tmp.len()
20378 }
20379 }
20380}
20381#[doc = "id: 37"]
20382#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20383#[derive(Debug, Clone, PartialEq)]
20384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20385#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20386pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20387 #[doc = "Start index"]
20388 pub start_index: i16,
20389 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20390 pub end_index: i16,
20391 #[doc = "System ID"]
20392 pub target_system: u8,
20393 #[doc = "Component ID"]
20394 pub target_component: u8,
20395 #[doc = "Mission type."]
20396 #[cfg_attr(feature = "serde", serde(default))]
20397 pub mission_type: MavMissionType,
20398}
20399impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20400 pub const ENCODED_LEN: usize = 7usize;
20401 pub const DEFAULT: Self = Self {
20402 start_index: 0_i16,
20403 end_index: 0_i16,
20404 target_system: 0_u8,
20405 target_component: 0_u8,
20406 mission_type: MavMissionType::DEFAULT,
20407 };
20408 #[cfg(feature = "arbitrary")]
20409 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20410 use arbitrary::{Arbitrary, Unstructured};
20411 let mut buf = [0u8; 1024];
20412 rng.fill_bytes(&mut buf);
20413 let mut unstructured = Unstructured::new(&buf);
20414 Self::arbitrary(&mut unstructured).unwrap_or_default()
20415 }
20416}
20417impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20418 fn default() -> Self {
20419 Self::DEFAULT.clone()
20420 }
20421}
20422impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20423 type Message = MavMessage;
20424 const ID: u32 = 37u32;
20425 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20426 const EXTRA_CRC: u8 = 212u8;
20427 const ENCODED_LEN: usize = 7usize;
20428 fn deser(
20429 _version: MavlinkVersion,
20430 __input: &[u8],
20431 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20432 let avail_len = __input.len();
20433 let mut payload_buf = [0; Self::ENCODED_LEN];
20434 let mut buf = if avail_len < Self::ENCODED_LEN {
20435 payload_buf[0..avail_len].copy_from_slice(__input);
20436 Bytes::new(&payload_buf)
20437 } else {
20438 Bytes::new(__input)
20439 };
20440 let mut __struct = Self::default();
20441 __struct.start_index = buf.get_i16_le();
20442 __struct.end_index = buf.get_i16_le();
20443 __struct.target_system = buf.get_u8();
20444 __struct.target_component = buf.get_u8();
20445 let tmp = buf.get_u8();
20446 __struct.mission_type =
20447 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20448 enum_type: "MavMissionType",
20449 value: tmp as u32,
20450 })?;
20451 Ok(__struct)
20452 }
20453 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20454 let mut __tmp = BytesMut::new(bytes);
20455 #[allow(clippy::absurd_extreme_comparisons)]
20456 #[allow(unused_comparisons)]
20457 if __tmp.remaining() < Self::ENCODED_LEN {
20458 panic!(
20459 "buffer is too small (need {} bytes, but got {})",
20460 Self::ENCODED_LEN,
20461 __tmp.remaining(),
20462 )
20463 }
20464 __tmp.put_i16_le(self.start_index);
20465 __tmp.put_i16_le(self.end_index);
20466 __tmp.put_u8(self.target_system);
20467 __tmp.put_u8(self.target_component);
20468 __tmp.put_u8(self.mission_type as u8);
20469 if matches!(version, MavlinkVersion::V2) {
20470 let len = __tmp.len();
20471 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20472 } else {
20473 __tmp.len()
20474 }
20475 }
20476}
20477#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20478#[doc = "id: 41"]
20479#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20480#[derive(Debug, Clone, PartialEq)]
20481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20483pub struct MISSION_SET_CURRENT_DATA {
20484 #[doc = "Sequence"]
20485 pub seq: u16,
20486 #[doc = "System ID"]
20487 pub target_system: u8,
20488 #[doc = "Component ID"]
20489 pub target_component: u8,
20490}
20491impl MISSION_SET_CURRENT_DATA {
20492 pub const ENCODED_LEN: usize = 4usize;
20493 pub const DEFAULT: Self = Self {
20494 seq: 0_u16,
20495 target_system: 0_u8,
20496 target_component: 0_u8,
20497 };
20498 #[cfg(feature = "arbitrary")]
20499 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20500 use arbitrary::{Arbitrary, Unstructured};
20501 let mut buf = [0u8; 1024];
20502 rng.fill_bytes(&mut buf);
20503 let mut unstructured = Unstructured::new(&buf);
20504 Self::arbitrary(&mut unstructured).unwrap_or_default()
20505 }
20506}
20507impl Default for MISSION_SET_CURRENT_DATA {
20508 fn default() -> Self {
20509 Self::DEFAULT.clone()
20510 }
20511}
20512impl MessageData for MISSION_SET_CURRENT_DATA {
20513 type Message = MavMessage;
20514 const ID: u32 = 41u32;
20515 const NAME: &'static str = "MISSION_SET_CURRENT";
20516 const EXTRA_CRC: u8 = 28u8;
20517 const ENCODED_LEN: usize = 4usize;
20518 fn deser(
20519 _version: MavlinkVersion,
20520 __input: &[u8],
20521 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20522 let avail_len = __input.len();
20523 let mut payload_buf = [0; Self::ENCODED_LEN];
20524 let mut buf = if avail_len < Self::ENCODED_LEN {
20525 payload_buf[0..avail_len].copy_from_slice(__input);
20526 Bytes::new(&payload_buf)
20527 } else {
20528 Bytes::new(__input)
20529 };
20530 let mut __struct = Self::default();
20531 __struct.seq = buf.get_u16_le();
20532 __struct.target_system = buf.get_u8();
20533 __struct.target_component = buf.get_u8();
20534 Ok(__struct)
20535 }
20536 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20537 let mut __tmp = BytesMut::new(bytes);
20538 #[allow(clippy::absurd_extreme_comparisons)]
20539 #[allow(unused_comparisons)]
20540 if __tmp.remaining() < Self::ENCODED_LEN {
20541 panic!(
20542 "buffer is too small (need {} bytes, but got {})",
20543 Self::ENCODED_LEN,
20544 __tmp.remaining(),
20545 )
20546 }
20547 __tmp.put_u16_le(self.seq);
20548 __tmp.put_u8(self.target_system);
20549 __tmp.put_u8(self.target_component);
20550 if matches!(version, MavlinkVersion::V2) {
20551 let len = __tmp.len();
20552 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20553 } else {
20554 __tmp.len()
20555 }
20556 }
20557}
20558#[doc = "id: 38"]
20559#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20560#[derive(Debug, Clone, PartialEq)]
20561#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20563pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20564 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20565 pub start_index: i16,
20566 #[doc = "End index, equal or greater than start index."]
20567 pub end_index: i16,
20568 #[doc = "System ID"]
20569 pub target_system: u8,
20570 #[doc = "Component ID"]
20571 pub target_component: u8,
20572 #[doc = "Mission type."]
20573 #[cfg_attr(feature = "serde", serde(default))]
20574 pub mission_type: MavMissionType,
20575}
20576impl MISSION_WRITE_PARTIAL_LIST_DATA {
20577 pub const ENCODED_LEN: usize = 7usize;
20578 pub const DEFAULT: Self = Self {
20579 start_index: 0_i16,
20580 end_index: 0_i16,
20581 target_system: 0_u8,
20582 target_component: 0_u8,
20583 mission_type: MavMissionType::DEFAULT,
20584 };
20585 #[cfg(feature = "arbitrary")]
20586 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20587 use arbitrary::{Arbitrary, Unstructured};
20588 let mut buf = [0u8; 1024];
20589 rng.fill_bytes(&mut buf);
20590 let mut unstructured = Unstructured::new(&buf);
20591 Self::arbitrary(&mut unstructured).unwrap_or_default()
20592 }
20593}
20594impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20595 fn default() -> Self {
20596 Self::DEFAULT.clone()
20597 }
20598}
20599impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20600 type Message = MavMessage;
20601 const ID: u32 = 38u32;
20602 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20603 const EXTRA_CRC: u8 = 9u8;
20604 const ENCODED_LEN: usize = 7usize;
20605 fn deser(
20606 _version: MavlinkVersion,
20607 __input: &[u8],
20608 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20609 let avail_len = __input.len();
20610 let mut payload_buf = [0; Self::ENCODED_LEN];
20611 let mut buf = if avail_len < Self::ENCODED_LEN {
20612 payload_buf[0..avail_len].copy_from_slice(__input);
20613 Bytes::new(&payload_buf)
20614 } else {
20615 Bytes::new(__input)
20616 };
20617 let mut __struct = Self::default();
20618 __struct.start_index = buf.get_i16_le();
20619 __struct.end_index = buf.get_i16_le();
20620 __struct.target_system = buf.get_u8();
20621 __struct.target_component = buf.get_u8();
20622 let tmp = buf.get_u8();
20623 __struct.mission_type =
20624 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20625 enum_type: "MavMissionType",
20626 value: tmp as u32,
20627 })?;
20628 Ok(__struct)
20629 }
20630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20631 let mut __tmp = BytesMut::new(bytes);
20632 #[allow(clippy::absurd_extreme_comparisons)]
20633 #[allow(unused_comparisons)]
20634 if __tmp.remaining() < Self::ENCODED_LEN {
20635 panic!(
20636 "buffer is too small (need {} bytes, but got {})",
20637 Self::ENCODED_LEN,
20638 __tmp.remaining(),
20639 )
20640 }
20641 __tmp.put_i16_le(self.start_index);
20642 __tmp.put_i16_le(self.end_index);
20643 __tmp.put_u8(self.target_system);
20644 __tmp.put_u8(self.target_component);
20645 __tmp.put_u8(self.mission_type as u8);
20646 if matches!(version, MavlinkVersion::V2) {
20647 let len = __tmp.len();
20648 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20649 } else {
20650 __tmp.len()
20651 }
20652 }
20653}
20654#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20655#[doc = "id: 265"]
20656#[doc = "Orientation of a mount."]
20657#[derive(Debug, Clone, PartialEq)]
20658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20660pub struct MOUNT_ORIENTATION_DATA {
20661 #[doc = "Timestamp (time since system boot)."]
20662 pub time_boot_ms: u32,
20663 #[doc = "Roll in global frame (set to NaN for invalid)."]
20664 pub roll: f32,
20665 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20666 pub pitch: f32,
20667 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20668 pub yaw: f32,
20669 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20670 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20671 pub yaw_absolute: f32,
20672}
20673impl MOUNT_ORIENTATION_DATA {
20674 pub const ENCODED_LEN: usize = 20usize;
20675 pub const DEFAULT: Self = Self {
20676 time_boot_ms: 0_u32,
20677 roll: 0.0_f32,
20678 pitch: 0.0_f32,
20679 yaw: 0.0_f32,
20680 yaw_absolute: 0.0_f32,
20681 };
20682 #[cfg(feature = "arbitrary")]
20683 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20684 use arbitrary::{Arbitrary, Unstructured};
20685 let mut buf = [0u8; 1024];
20686 rng.fill_bytes(&mut buf);
20687 let mut unstructured = Unstructured::new(&buf);
20688 Self::arbitrary(&mut unstructured).unwrap_or_default()
20689 }
20690}
20691impl Default for MOUNT_ORIENTATION_DATA {
20692 fn default() -> Self {
20693 Self::DEFAULT.clone()
20694 }
20695}
20696impl MessageData for MOUNT_ORIENTATION_DATA {
20697 type Message = MavMessage;
20698 const ID: u32 = 265u32;
20699 const NAME: &'static str = "MOUNT_ORIENTATION";
20700 const EXTRA_CRC: u8 = 26u8;
20701 const ENCODED_LEN: usize = 20usize;
20702 fn deser(
20703 _version: MavlinkVersion,
20704 __input: &[u8],
20705 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20706 let avail_len = __input.len();
20707 let mut payload_buf = [0; Self::ENCODED_LEN];
20708 let mut buf = if avail_len < Self::ENCODED_LEN {
20709 payload_buf[0..avail_len].copy_from_slice(__input);
20710 Bytes::new(&payload_buf)
20711 } else {
20712 Bytes::new(__input)
20713 };
20714 let mut __struct = Self::default();
20715 __struct.time_boot_ms = buf.get_u32_le();
20716 __struct.roll = buf.get_f32_le();
20717 __struct.pitch = buf.get_f32_le();
20718 __struct.yaw = buf.get_f32_le();
20719 __struct.yaw_absolute = buf.get_f32_le();
20720 Ok(__struct)
20721 }
20722 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20723 let mut __tmp = BytesMut::new(bytes);
20724 #[allow(clippy::absurd_extreme_comparisons)]
20725 #[allow(unused_comparisons)]
20726 if __tmp.remaining() < Self::ENCODED_LEN {
20727 panic!(
20728 "buffer is too small (need {} bytes, but got {})",
20729 Self::ENCODED_LEN,
20730 __tmp.remaining(),
20731 )
20732 }
20733 __tmp.put_u32_le(self.time_boot_ms);
20734 __tmp.put_f32_le(self.roll);
20735 __tmp.put_f32_le(self.pitch);
20736 __tmp.put_f32_le(self.yaw);
20737 __tmp.put_f32_le(self.yaw_absolute);
20738 if matches!(version, MavlinkVersion::V2) {
20739 let len = __tmp.len();
20740 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20741 } else {
20742 __tmp.len()
20743 }
20744 }
20745}
20746#[doc = "id: 251"]
20747#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20748#[derive(Debug, Clone, PartialEq)]
20749#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20751pub struct NAMED_VALUE_FLOAT_DATA {
20752 #[doc = "Timestamp (time since system boot)."]
20753 pub time_boot_ms: u32,
20754 #[doc = "Floating point value"]
20755 pub value: f32,
20756 #[doc = "Name of the debug variable"]
20757 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20758 pub name: [u8; 10],
20759}
20760impl NAMED_VALUE_FLOAT_DATA {
20761 pub const ENCODED_LEN: usize = 18usize;
20762 pub const DEFAULT: Self = Self {
20763 time_boot_ms: 0_u32,
20764 value: 0.0_f32,
20765 name: [0_u8; 10usize],
20766 };
20767 #[cfg(feature = "arbitrary")]
20768 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20769 use arbitrary::{Arbitrary, Unstructured};
20770 let mut buf = [0u8; 1024];
20771 rng.fill_bytes(&mut buf);
20772 let mut unstructured = Unstructured::new(&buf);
20773 Self::arbitrary(&mut unstructured).unwrap_or_default()
20774 }
20775}
20776impl Default for NAMED_VALUE_FLOAT_DATA {
20777 fn default() -> Self {
20778 Self::DEFAULT.clone()
20779 }
20780}
20781impl MessageData for NAMED_VALUE_FLOAT_DATA {
20782 type Message = MavMessage;
20783 const ID: u32 = 251u32;
20784 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20785 const EXTRA_CRC: u8 = 170u8;
20786 const ENCODED_LEN: usize = 18usize;
20787 fn deser(
20788 _version: MavlinkVersion,
20789 __input: &[u8],
20790 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20791 let avail_len = __input.len();
20792 let mut payload_buf = [0; Self::ENCODED_LEN];
20793 let mut buf = if avail_len < Self::ENCODED_LEN {
20794 payload_buf[0..avail_len].copy_from_slice(__input);
20795 Bytes::new(&payload_buf)
20796 } else {
20797 Bytes::new(__input)
20798 };
20799 let mut __struct = Self::default();
20800 __struct.time_boot_ms = buf.get_u32_le();
20801 __struct.value = buf.get_f32_le();
20802 for v in &mut __struct.name {
20803 let val = buf.get_u8();
20804 *v = val;
20805 }
20806 Ok(__struct)
20807 }
20808 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20809 let mut __tmp = BytesMut::new(bytes);
20810 #[allow(clippy::absurd_extreme_comparisons)]
20811 #[allow(unused_comparisons)]
20812 if __tmp.remaining() < Self::ENCODED_LEN {
20813 panic!(
20814 "buffer is too small (need {} bytes, but got {})",
20815 Self::ENCODED_LEN,
20816 __tmp.remaining(),
20817 )
20818 }
20819 __tmp.put_u32_le(self.time_boot_ms);
20820 __tmp.put_f32_le(self.value);
20821 for val in &self.name {
20822 __tmp.put_u8(*val);
20823 }
20824 if matches!(version, MavlinkVersion::V2) {
20825 let len = __tmp.len();
20826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20827 } else {
20828 __tmp.len()
20829 }
20830 }
20831}
20832#[doc = "id: 252"]
20833#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20834#[derive(Debug, Clone, PartialEq)]
20835#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20836#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20837pub struct NAMED_VALUE_INT_DATA {
20838 #[doc = "Timestamp (time since system boot)."]
20839 pub time_boot_ms: u32,
20840 #[doc = "Signed integer value"]
20841 pub value: i32,
20842 #[doc = "Name of the debug variable"]
20843 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20844 pub name: [u8; 10],
20845}
20846impl NAMED_VALUE_INT_DATA {
20847 pub const ENCODED_LEN: usize = 18usize;
20848 pub const DEFAULT: Self = Self {
20849 time_boot_ms: 0_u32,
20850 value: 0_i32,
20851 name: [0_u8; 10usize],
20852 };
20853 #[cfg(feature = "arbitrary")]
20854 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20855 use arbitrary::{Arbitrary, Unstructured};
20856 let mut buf = [0u8; 1024];
20857 rng.fill_bytes(&mut buf);
20858 let mut unstructured = Unstructured::new(&buf);
20859 Self::arbitrary(&mut unstructured).unwrap_or_default()
20860 }
20861}
20862impl Default for NAMED_VALUE_INT_DATA {
20863 fn default() -> Self {
20864 Self::DEFAULT.clone()
20865 }
20866}
20867impl MessageData for NAMED_VALUE_INT_DATA {
20868 type Message = MavMessage;
20869 const ID: u32 = 252u32;
20870 const NAME: &'static str = "NAMED_VALUE_INT";
20871 const EXTRA_CRC: u8 = 44u8;
20872 const ENCODED_LEN: usize = 18usize;
20873 fn deser(
20874 _version: MavlinkVersion,
20875 __input: &[u8],
20876 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20877 let avail_len = __input.len();
20878 let mut payload_buf = [0; Self::ENCODED_LEN];
20879 let mut buf = if avail_len < Self::ENCODED_LEN {
20880 payload_buf[0..avail_len].copy_from_slice(__input);
20881 Bytes::new(&payload_buf)
20882 } else {
20883 Bytes::new(__input)
20884 };
20885 let mut __struct = Self::default();
20886 __struct.time_boot_ms = buf.get_u32_le();
20887 __struct.value = buf.get_i32_le();
20888 for v in &mut __struct.name {
20889 let val = buf.get_u8();
20890 *v = val;
20891 }
20892 Ok(__struct)
20893 }
20894 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20895 let mut __tmp = BytesMut::new(bytes);
20896 #[allow(clippy::absurd_extreme_comparisons)]
20897 #[allow(unused_comparisons)]
20898 if __tmp.remaining() < Self::ENCODED_LEN {
20899 panic!(
20900 "buffer is too small (need {} bytes, but got {})",
20901 Self::ENCODED_LEN,
20902 __tmp.remaining(),
20903 )
20904 }
20905 __tmp.put_u32_le(self.time_boot_ms);
20906 __tmp.put_i32_le(self.value);
20907 for val in &self.name {
20908 __tmp.put_u8(*val);
20909 }
20910 if matches!(version, MavlinkVersion::V2) {
20911 let len = __tmp.len();
20912 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20913 } else {
20914 __tmp.len()
20915 }
20916 }
20917}
20918#[doc = "id: 62"]
20919#[doc = "The state of the navigation and position controller."]
20920#[derive(Debug, Clone, PartialEq)]
20921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20923pub struct NAV_CONTROLLER_OUTPUT_DATA {
20924 #[doc = "Current desired roll"]
20925 pub nav_roll: f32,
20926 #[doc = "Current desired pitch"]
20927 pub nav_pitch: f32,
20928 #[doc = "Current altitude error"]
20929 pub alt_error: f32,
20930 #[doc = "Current airspeed error"]
20931 pub aspd_error: f32,
20932 #[doc = "Current crosstrack error on x-y plane"]
20933 pub xtrack_error: f32,
20934 #[doc = "Current desired heading"]
20935 pub nav_bearing: i16,
20936 #[doc = "Bearing to current waypoint/target"]
20937 pub target_bearing: i16,
20938 #[doc = "Distance to active waypoint"]
20939 pub wp_dist: u16,
20940}
20941impl NAV_CONTROLLER_OUTPUT_DATA {
20942 pub const ENCODED_LEN: usize = 26usize;
20943 pub const DEFAULT: Self = Self {
20944 nav_roll: 0.0_f32,
20945 nav_pitch: 0.0_f32,
20946 alt_error: 0.0_f32,
20947 aspd_error: 0.0_f32,
20948 xtrack_error: 0.0_f32,
20949 nav_bearing: 0_i16,
20950 target_bearing: 0_i16,
20951 wp_dist: 0_u16,
20952 };
20953 #[cfg(feature = "arbitrary")]
20954 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20955 use arbitrary::{Arbitrary, Unstructured};
20956 let mut buf = [0u8; 1024];
20957 rng.fill_bytes(&mut buf);
20958 let mut unstructured = Unstructured::new(&buf);
20959 Self::arbitrary(&mut unstructured).unwrap_or_default()
20960 }
20961}
20962impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20963 fn default() -> Self {
20964 Self::DEFAULT.clone()
20965 }
20966}
20967impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20968 type Message = MavMessage;
20969 const ID: u32 = 62u32;
20970 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20971 const EXTRA_CRC: u8 = 183u8;
20972 const ENCODED_LEN: usize = 26usize;
20973 fn deser(
20974 _version: MavlinkVersion,
20975 __input: &[u8],
20976 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20977 let avail_len = __input.len();
20978 let mut payload_buf = [0; Self::ENCODED_LEN];
20979 let mut buf = if avail_len < Self::ENCODED_LEN {
20980 payload_buf[0..avail_len].copy_from_slice(__input);
20981 Bytes::new(&payload_buf)
20982 } else {
20983 Bytes::new(__input)
20984 };
20985 let mut __struct = Self::default();
20986 __struct.nav_roll = buf.get_f32_le();
20987 __struct.nav_pitch = buf.get_f32_le();
20988 __struct.alt_error = buf.get_f32_le();
20989 __struct.aspd_error = buf.get_f32_le();
20990 __struct.xtrack_error = buf.get_f32_le();
20991 __struct.nav_bearing = buf.get_i16_le();
20992 __struct.target_bearing = buf.get_i16_le();
20993 __struct.wp_dist = buf.get_u16_le();
20994 Ok(__struct)
20995 }
20996 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20997 let mut __tmp = BytesMut::new(bytes);
20998 #[allow(clippy::absurd_extreme_comparisons)]
20999 #[allow(unused_comparisons)]
21000 if __tmp.remaining() < Self::ENCODED_LEN {
21001 panic!(
21002 "buffer is too small (need {} bytes, but got {})",
21003 Self::ENCODED_LEN,
21004 __tmp.remaining(),
21005 )
21006 }
21007 __tmp.put_f32_le(self.nav_roll);
21008 __tmp.put_f32_le(self.nav_pitch);
21009 __tmp.put_f32_le(self.alt_error);
21010 __tmp.put_f32_le(self.aspd_error);
21011 __tmp.put_f32_le(self.xtrack_error);
21012 __tmp.put_i16_le(self.nav_bearing);
21013 __tmp.put_i16_le(self.target_bearing);
21014 __tmp.put_u16_le(self.wp_dist);
21015 if matches!(version, MavlinkVersion::V2) {
21016 let len = __tmp.len();
21017 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21018 } else {
21019 __tmp.len()
21020 }
21021 }
21022}
21023#[doc = "id: 330"]
21024#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21025#[derive(Debug, Clone, PartialEq)]
21026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21027#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21028pub struct OBSTACLE_DISTANCE_DATA {
21029 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21030 pub time_usec: u64,
21031 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21032 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21033 pub distances: [u16; 72],
21034 #[doc = "Minimum distance the sensor can measure."]
21035 pub min_distance: u16,
21036 #[doc = "Maximum distance the sensor can measure."]
21037 pub max_distance: u16,
21038 #[doc = "Class id of the distance sensor type."]
21039 pub sensor_type: MavDistanceSensor,
21040 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21041 pub increment: u8,
21042 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21043 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21044 pub increment_f: f32,
21045 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21046 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21047 pub angle_offset: f32,
21048 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21049 #[cfg_attr(feature = "serde", serde(default))]
21050 pub frame: MavFrame,
21051}
21052impl OBSTACLE_DISTANCE_DATA {
21053 pub const ENCODED_LEN: usize = 167usize;
21054 pub const DEFAULT: Self = Self {
21055 time_usec: 0_u64,
21056 distances: [0_u16; 72usize],
21057 min_distance: 0_u16,
21058 max_distance: 0_u16,
21059 sensor_type: MavDistanceSensor::DEFAULT,
21060 increment: 0_u8,
21061 increment_f: 0.0_f32,
21062 angle_offset: 0.0_f32,
21063 frame: MavFrame::DEFAULT,
21064 };
21065 #[cfg(feature = "arbitrary")]
21066 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21067 use arbitrary::{Arbitrary, Unstructured};
21068 let mut buf = [0u8; 1024];
21069 rng.fill_bytes(&mut buf);
21070 let mut unstructured = Unstructured::new(&buf);
21071 Self::arbitrary(&mut unstructured).unwrap_or_default()
21072 }
21073}
21074impl Default for OBSTACLE_DISTANCE_DATA {
21075 fn default() -> Self {
21076 Self::DEFAULT.clone()
21077 }
21078}
21079impl MessageData for OBSTACLE_DISTANCE_DATA {
21080 type Message = MavMessage;
21081 const ID: u32 = 330u32;
21082 const NAME: &'static str = "OBSTACLE_DISTANCE";
21083 const EXTRA_CRC: u8 = 23u8;
21084 const ENCODED_LEN: usize = 167usize;
21085 fn deser(
21086 _version: MavlinkVersion,
21087 __input: &[u8],
21088 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21089 let avail_len = __input.len();
21090 let mut payload_buf = [0; Self::ENCODED_LEN];
21091 let mut buf = if avail_len < Self::ENCODED_LEN {
21092 payload_buf[0..avail_len].copy_from_slice(__input);
21093 Bytes::new(&payload_buf)
21094 } else {
21095 Bytes::new(__input)
21096 };
21097 let mut __struct = Self::default();
21098 __struct.time_usec = buf.get_u64_le();
21099 for v in &mut __struct.distances {
21100 let val = buf.get_u16_le();
21101 *v = val;
21102 }
21103 __struct.min_distance = buf.get_u16_le();
21104 __struct.max_distance = buf.get_u16_le();
21105 let tmp = buf.get_u8();
21106 __struct.sensor_type =
21107 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21108 enum_type: "MavDistanceSensor",
21109 value: tmp as u32,
21110 })?;
21111 __struct.increment = buf.get_u8();
21112 __struct.increment_f = buf.get_f32_le();
21113 __struct.angle_offset = buf.get_f32_le();
21114 let tmp = buf.get_u8();
21115 __struct.frame =
21116 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21117 enum_type: "MavFrame",
21118 value: tmp as u32,
21119 })?;
21120 Ok(__struct)
21121 }
21122 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21123 let mut __tmp = BytesMut::new(bytes);
21124 #[allow(clippy::absurd_extreme_comparisons)]
21125 #[allow(unused_comparisons)]
21126 if __tmp.remaining() < Self::ENCODED_LEN {
21127 panic!(
21128 "buffer is too small (need {} bytes, but got {})",
21129 Self::ENCODED_LEN,
21130 __tmp.remaining(),
21131 )
21132 }
21133 __tmp.put_u64_le(self.time_usec);
21134 for val in &self.distances {
21135 __tmp.put_u16_le(*val);
21136 }
21137 __tmp.put_u16_le(self.min_distance);
21138 __tmp.put_u16_le(self.max_distance);
21139 __tmp.put_u8(self.sensor_type as u8);
21140 __tmp.put_u8(self.increment);
21141 __tmp.put_f32_le(self.increment_f);
21142 __tmp.put_f32_le(self.angle_offset);
21143 __tmp.put_u8(self.frame as u8);
21144 if matches!(version, MavlinkVersion::V2) {
21145 let len = __tmp.len();
21146 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21147 } else {
21148 __tmp.len()
21149 }
21150 }
21151}
21152#[doc = "id: 331"]
21153#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21154#[derive(Debug, Clone, PartialEq)]
21155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21157pub struct ODOMETRY_DATA {
21158 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21159 pub time_usec: u64,
21160 #[doc = "X Position"]
21161 pub x: f32,
21162 #[doc = "Y Position"]
21163 pub y: f32,
21164 #[doc = "Z Position"]
21165 pub z: f32,
21166 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21167 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21168 pub q: [f32; 4],
21169 #[doc = "X linear speed"]
21170 pub vx: f32,
21171 #[doc = "Y linear speed"]
21172 pub vy: f32,
21173 #[doc = "Z linear speed"]
21174 pub vz: f32,
21175 #[doc = "Roll angular speed"]
21176 pub rollspeed: f32,
21177 #[doc = "Pitch angular speed"]
21178 pub pitchspeed: f32,
21179 #[doc = "Yaw angular speed"]
21180 pub yawspeed: f32,
21181 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21182 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21183 pub pose_covariance: [f32; 21],
21184 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21185 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21186 pub velocity_covariance: [f32; 21],
21187 #[doc = "Coordinate frame of reference for the pose data."]
21188 pub frame_id: MavFrame,
21189 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21190 pub child_frame_id: MavFrame,
21191 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21192 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21193 pub reset_counter: u8,
21194 #[doc = "Type of estimator that is providing the odometry."]
21195 #[cfg_attr(feature = "serde", serde(default))]
21196 pub estimator_type: MavEstimatorType,
21197 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21198 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21199 pub quality: i8,
21200}
21201impl ODOMETRY_DATA {
21202 pub const ENCODED_LEN: usize = 233usize;
21203 pub const DEFAULT: Self = Self {
21204 time_usec: 0_u64,
21205 x: 0.0_f32,
21206 y: 0.0_f32,
21207 z: 0.0_f32,
21208 q: [0.0_f32; 4usize],
21209 vx: 0.0_f32,
21210 vy: 0.0_f32,
21211 vz: 0.0_f32,
21212 rollspeed: 0.0_f32,
21213 pitchspeed: 0.0_f32,
21214 yawspeed: 0.0_f32,
21215 pose_covariance: [0.0_f32; 21usize],
21216 velocity_covariance: [0.0_f32; 21usize],
21217 frame_id: MavFrame::DEFAULT,
21218 child_frame_id: MavFrame::DEFAULT,
21219 reset_counter: 0_u8,
21220 estimator_type: MavEstimatorType::DEFAULT,
21221 quality: 0_i8,
21222 };
21223 #[cfg(feature = "arbitrary")]
21224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21225 use arbitrary::{Arbitrary, Unstructured};
21226 let mut buf = [0u8; 1024];
21227 rng.fill_bytes(&mut buf);
21228 let mut unstructured = Unstructured::new(&buf);
21229 Self::arbitrary(&mut unstructured).unwrap_or_default()
21230 }
21231}
21232impl Default for ODOMETRY_DATA {
21233 fn default() -> Self {
21234 Self::DEFAULT.clone()
21235 }
21236}
21237impl MessageData for ODOMETRY_DATA {
21238 type Message = MavMessage;
21239 const ID: u32 = 331u32;
21240 const NAME: &'static str = "ODOMETRY";
21241 const EXTRA_CRC: u8 = 91u8;
21242 const ENCODED_LEN: usize = 233usize;
21243 fn deser(
21244 _version: MavlinkVersion,
21245 __input: &[u8],
21246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21247 let avail_len = __input.len();
21248 let mut payload_buf = [0; Self::ENCODED_LEN];
21249 let mut buf = if avail_len < Self::ENCODED_LEN {
21250 payload_buf[0..avail_len].copy_from_slice(__input);
21251 Bytes::new(&payload_buf)
21252 } else {
21253 Bytes::new(__input)
21254 };
21255 let mut __struct = Self::default();
21256 __struct.time_usec = buf.get_u64_le();
21257 __struct.x = buf.get_f32_le();
21258 __struct.y = buf.get_f32_le();
21259 __struct.z = buf.get_f32_le();
21260 for v in &mut __struct.q {
21261 let val = buf.get_f32_le();
21262 *v = val;
21263 }
21264 __struct.vx = buf.get_f32_le();
21265 __struct.vy = buf.get_f32_le();
21266 __struct.vz = buf.get_f32_le();
21267 __struct.rollspeed = buf.get_f32_le();
21268 __struct.pitchspeed = buf.get_f32_le();
21269 __struct.yawspeed = buf.get_f32_le();
21270 for v in &mut __struct.pose_covariance {
21271 let val = buf.get_f32_le();
21272 *v = val;
21273 }
21274 for v in &mut __struct.velocity_covariance {
21275 let val = buf.get_f32_le();
21276 *v = val;
21277 }
21278 let tmp = buf.get_u8();
21279 __struct.frame_id =
21280 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21281 enum_type: "MavFrame",
21282 value: tmp as u32,
21283 })?;
21284 let tmp = buf.get_u8();
21285 __struct.child_frame_id =
21286 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21287 enum_type: "MavFrame",
21288 value: tmp as u32,
21289 })?;
21290 __struct.reset_counter = buf.get_u8();
21291 let tmp = buf.get_u8();
21292 __struct.estimator_type =
21293 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21294 enum_type: "MavEstimatorType",
21295 value: tmp as u32,
21296 })?;
21297 __struct.quality = buf.get_i8();
21298 Ok(__struct)
21299 }
21300 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21301 let mut __tmp = BytesMut::new(bytes);
21302 #[allow(clippy::absurd_extreme_comparisons)]
21303 #[allow(unused_comparisons)]
21304 if __tmp.remaining() < Self::ENCODED_LEN {
21305 panic!(
21306 "buffer is too small (need {} bytes, but got {})",
21307 Self::ENCODED_LEN,
21308 __tmp.remaining(),
21309 )
21310 }
21311 __tmp.put_u64_le(self.time_usec);
21312 __tmp.put_f32_le(self.x);
21313 __tmp.put_f32_le(self.y);
21314 __tmp.put_f32_le(self.z);
21315 for val in &self.q {
21316 __tmp.put_f32_le(*val);
21317 }
21318 __tmp.put_f32_le(self.vx);
21319 __tmp.put_f32_le(self.vy);
21320 __tmp.put_f32_le(self.vz);
21321 __tmp.put_f32_le(self.rollspeed);
21322 __tmp.put_f32_le(self.pitchspeed);
21323 __tmp.put_f32_le(self.yawspeed);
21324 for val in &self.pose_covariance {
21325 __tmp.put_f32_le(*val);
21326 }
21327 for val in &self.velocity_covariance {
21328 __tmp.put_f32_le(*val);
21329 }
21330 __tmp.put_u8(self.frame_id as u8);
21331 __tmp.put_u8(self.child_frame_id as u8);
21332 __tmp.put_u8(self.reset_counter);
21333 __tmp.put_u8(self.estimator_type as u8);
21334 __tmp.put_i8(self.quality);
21335 if matches!(version, MavlinkVersion::V2) {
21336 let len = __tmp.len();
21337 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21338 } else {
21339 __tmp.len()
21340 }
21341 }
21342}
21343#[doc = "id: 390"]
21344#[doc = "Hardware status sent by an onboard computer."]
21345#[derive(Debug, Clone, PartialEq)]
21346#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21347#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21348pub struct ONBOARD_COMPUTER_STATUS_DATA {
21349 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21350 pub time_usec: u64,
21351 #[doc = "Time since system boot."]
21352 pub uptime: u32,
21353 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21354 pub ram_usage: u32,
21355 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21356 pub ram_total: u32,
21357 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21358 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21359 pub storage_type: [u32; 4],
21360 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21361 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21362 pub storage_usage: [u32; 4],
21363 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21364 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21365 pub storage_total: [u32; 4],
21366 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21367 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21368 pub link_type: [u32; 6],
21369 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21370 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21371 pub link_tx_rate: [u32; 6],
21372 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21373 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21374 pub link_rx_rate: [u32; 6],
21375 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21376 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21377 pub link_tx_max: [u32; 6],
21378 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21379 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21380 pub link_rx_max: [u32; 6],
21381 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21382 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21383 pub fan_speed: [i16; 4],
21384 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21385 pub mavtype: u8,
21386 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21387 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21388 pub cpu_cores: [u8; 8],
21389 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21390 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21391 pub cpu_combined: [u8; 10],
21392 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21393 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21394 pub gpu_cores: [u8; 4],
21395 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21396 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21397 pub gpu_combined: [u8; 10],
21398 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21399 pub temperature_board: i8,
21400 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21401 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21402 pub temperature_core: [i8; 8],
21403}
21404impl ONBOARD_COMPUTER_STATUS_DATA {
21405 pub const ENCODED_LEN: usize = 238usize;
21406 pub const DEFAULT: Self = Self {
21407 time_usec: 0_u64,
21408 uptime: 0_u32,
21409 ram_usage: 0_u32,
21410 ram_total: 0_u32,
21411 storage_type: [0_u32; 4usize],
21412 storage_usage: [0_u32; 4usize],
21413 storage_total: [0_u32; 4usize],
21414 link_type: [0_u32; 6usize],
21415 link_tx_rate: [0_u32; 6usize],
21416 link_rx_rate: [0_u32; 6usize],
21417 link_tx_max: [0_u32; 6usize],
21418 link_rx_max: [0_u32; 6usize],
21419 fan_speed: [0_i16; 4usize],
21420 mavtype: 0_u8,
21421 cpu_cores: [0_u8; 8usize],
21422 cpu_combined: [0_u8; 10usize],
21423 gpu_cores: [0_u8; 4usize],
21424 gpu_combined: [0_u8; 10usize],
21425 temperature_board: 0_i8,
21426 temperature_core: [0_i8; 8usize],
21427 };
21428 #[cfg(feature = "arbitrary")]
21429 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21430 use arbitrary::{Arbitrary, Unstructured};
21431 let mut buf = [0u8; 1024];
21432 rng.fill_bytes(&mut buf);
21433 let mut unstructured = Unstructured::new(&buf);
21434 Self::arbitrary(&mut unstructured).unwrap_or_default()
21435 }
21436}
21437impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21438 fn default() -> Self {
21439 Self::DEFAULT.clone()
21440 }
21441}
21442impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21443 type Message = MavMessage;
21444 const ID: u32 = 390u32;
21445 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21446 const EXTRA_CRC: u8 = 156u8;
21447 const ENCODED_LEN: usize = 238usize;
21448 fn deser(
21449 _version: MavlinkVersion,
21450 __input: &[u8],
21451 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21452 let avail_len = __input.len();
21453 let mut payload_buf = [0; Self::ENCODED_LEN];
21454 let mut buf = if avail_len < Self::ENCODED_LEN {
21455 payload_buf[0..avail_len].copy_from_slice(__input);
21456 Bytes::new(&payload_buf)
21457 } else {
21458 Bytes::new(__input)
21459 };
21460 let mut __struct = Self::default();
21461 __struct.time_usec = buf.get_u64_le();
21462 __struct.uptime = buf.get_u32_le();
21463 __struct.ram_usage = buf.get_u32_le();
21464 __struct.ram_total = buf.get_u32_le();
21465 for v in &mut __struct.storage_type {
21466 let val = buf.get_u32_le();
21467 *v = val;
21468 }
21469 for v in &mut __struct.storage_usage {
21470 let val = buf.get_u32_le();
21471 *v = val;
21472 }
21473 for v in &mut __struct.storage_total {
21474 let val = buf.get_u32_le();
21475 *v = val;
21476 }
21477 for v in &mut __struct.link_type {
21478 let val = buf.get_u32_le();
21479 *v = val;
21480 }
21481 for v in &mut __struct.link_tx_rate {
21482 let val = buf.get_u32_le();
21483 *v = val;
21484 }
21485 for v in &mut __struct.link_rx_rate {
21486 let val = buf.get_u32_le();
21487 *v = val;
21488 }
21489 for v in &mut __struct.link_tx_max {
21490 let val = buf.get_u32_le();
21491 *v = val;
21492 }
21493 for v in &mut __struct.link_rx_max {
21494 let val = buf.get_u32_le();
21495 *v = val;
21496 }
21497 for v in &mut __struct.fan_speed {
21498 let val = buf.get_i16_le();
21499 *v = val;
21500 }
21501 __struct.mavtype = buf.get_u8();
21502 for v in &mut __struct.cpu_cores {
21503 let val = buf.get_u8();
21504 *v = val;
21505 }
21506 for v in &mut __struct.cpu_combined {
21507 let val = buf.get_u8();
21508 *v = val;
21509 }
21510 for v in &mut __struct.gpu_cores {
21511 let val = buf.get_u8();
21512 *v = val;
21513 }
21514 for v in &mut __struct.gpu_combined {
21515 let val = buf.get_u8();
21516 *v = val;
21517 }
21518 __struct.temperature_board = buf.get_i8();
21519 for v in &mut __struct.temperature_core {
21520 let val = buf.get_i8();
21521 *v = val;
21522 }
21523 Ok(__struct)
21524 }
21525 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21526 let mut __tmp = BytesMut::new(bytes);
21527 #[allow(clippy::absurd_extreme_comparisons)]
21528 #[allow(unused_comparisons)]
21529 if __tmp.remaining() < Self::ENCODED_LEN {
21530 panic!(
21531 "buffer is too small (need {} bytes, but got {})",
21532 Self::ENCODED_LEN,
21533 __tmp.remaining(),
21534 )
21535 }
21536 __tmp.put_u64_le(self.time_usec);
21537 __tmp.put_u32_le(self.uptime);
21538 __tmp.put_u32_le(self.ram_usage);
21539 __tmp.put_u32_le(self.ram_total);
21540 for val in &self.storage_type {
21541 __tmp.put_u32_le(*val);
21542 }
21543 for val in &self.storage_usage {
21544 __tmp.put_u32_le(*val);
21545 }
21546 for val in &self.storage_total {
21547 __tmp.put_u32_le(*val);
21548 }
21549 for val in &self.link_type {
21550 __tmp.put_u32_le(*val);
21551 }
21552 for val in &self.link_tx_rate {
21553 __tmp.put_u32_le(*val);
21554 }
21555 for val in &self.link_rx_rate {
21556 __tmp.put_u32_le(*val);
21557 }
21558 for val in &self.link_tx_max {
21559 __tmp.put_u32_le(*val);
21560 }
21561 for val in &self.link_rx_max {
21562 __tmp.put_u32_le(*val);
21563 }
21564 for val in &self.fan_speed {
21565 __tmp.put_i16_le(*val);
21566 }
21567 __tmp.put_u8(self.mavtype);
21568 for val in &self.cpu_cores {
21569 __tmp.put_u8(*val);
21570 }
21571 for val in &self.cpu_combined {
21572 __tmp.put_u8(*val);
21573 }
21574 for val in &self.gpu_cores {
21575 __tmp.put_u8(*val);
21576 }
21577 for val in &self.gpu_combined {
21578 __tmp.put_u8(*val);
21579 }
21580 __tmp.put_i8(self.temperature_board);
21581 for val in &self.temperature_core {
21582 __tmp.put_i8(*val);
21583 }
21584 if matches!(version, MavlinkVersion::V2) {
21585 let len = __tmp.len();
21586 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21587 } else {
21588 __tmp.len()
21589 }
21590 }
21591}
21592#[doc = "id: 12918"]
21593#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21594#[derive(Debug, Clone, PartialEq)]
21595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21597pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21598 #[doc = "Status level indicating if arming is allowed."]
21599 pub status: MavOdidArmStatus,
21600 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21601 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21602 pub error: [u8; 50],
21603}
21604impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21605 pub const ENCODED_LEN: usize = 51usize;
21606 pub const DEFAULT: Self = Self {
21607 status: MavOdidArmStatus::DEFAULT,
21608 error: [0_u8; 50usize],
21609 };
21610 #[cfg(feature = "arbitrary")]
21611 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21612 use arbitrary::{Arbitrary, Unstructured};
21613 let mut buf = [0u8; 1024];
21614 rng.fill_bytes(&mut buf);
21615 let mut unstructured = Unstructured::new(&buf);
21616 Self::arbitrary(&mut unstructured).unwrap_or_default()
21617 }
21618}
21619impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21620 fn default() -> Self {
21621 Self::DEFAULT.clone()
21622 }
21623}
21624impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21625 type Message = MavMessage;
21626 const ID: u32 = 12918u32;
21627 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21628 const EXTRA_CRC: u8 = 139u8;
21629 const ENCODED_LEN: usize = 51usize;
21630 fn deser(
21631 _version: MavlinkVersion,
21632 __input: &[u8],
21633 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21634 let avail_len = __input.len();
21635 let mut payload_buf = [0; Self::ENCODED_LEN];
21636 let mut buf = if avail_len < Self::ENCODED_LEN {
21637 payload_buf[0..avail_len].copy_from_slice(__input);
21638 Bytes::new(&payload_buf)
21639 } else {
21640 Bytes::new(__input)
21641 };
21642 let mut __struct = Self::default();
21643 let tmp = buf.get_u8();
21644 __struct.status =
21645 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21646 enum_type: "MavOdidArmStatus",
21647 value: tmp as u32,
21648 })?;
21649 for v in &mut __struct.error {
21650 let val = buf.get_u8();
21651 *v = val;
21652 }
21653 Ok(__struct)
21654 }
21655 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21656 let mut __tmp = BytesMut::new(bytes);
21657 #[allow(clippy::absurd_extreme_comparisons)]
21658 #[allow(unused_comparisons)]
21659 if __tmp.remaining() < Self::ENCODED_LEN {
21660 panic!(
21661 "buffer is too small (need {} bytes, but got {})",
21662 Self::ENCODED_LEN,
21663 __tmp.remaining(),
21664 )
21665 }
21666 __tmp.put_u8(self.status as u8);
21667 for val in &self.error {
21668 __tmp.put_u8(*val);
21669 }
21670 if matches!(version, MavlinkVersion::V2) {
21671 let len = __tmp.len();
21672 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21673 } else {
21674 __tmp.len()
21675 }
21676 }
21677}
21678#[doc = "id: 12902"]
21679#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
21680#[derive(Debug, Clone, PartialEq)]
21681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21683pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21684 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21685 pub timestamp: u32,
21686 #[doc = "System ID (0 for broadcast)."]
21687 pub target_system: u8,
21688 #[doc = "Component ID (0 for broadcast)."]
21689 pub target_component: u8,
21690 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21691 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21692 pub id_or_mac: [u8; 20],
21693 #[doc = "Indicates the type of authentication."]
21694 pub authentication_type: MavOdidAuthType,
21695 #[doc = "Allowed range is 0 - 15."]
21696 pub data_page: u8,
21697 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21698 pub last_page_index: u8,
21699 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21700 pub length: u8,
21701 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21702 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21703 pub authentication_data: [u8; 23],
21704}
21705impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21706 pub const ENCODED_LEN: usize = 53usize;
21707 pub const DEFAULT: Self = Self {
21708 timestamp: 0_u32,
21709 target_system: 0_u8,
21710 target_component: 0_u8,
21711 id_or_mac: [0_u8; 20usize],
21712 authentication_type: MavOdidAuthType::DEFAULT,
21713 data_page: 0_u8,
21714 last_page_index: 0_u8,
21715 length: 0_u8,
21716 authentication_data: [0_u8; 23usize],
21717 };
21718 #[cfg(feature = "arbitrary")]
21719 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21720 use arbitrary::{Arbitrary, Unstructured};
21721 let mut buf = [0u8; 1024];
21722 rng.fill_bytes(&mut buf);
21723 let mut unstructured = Unstructured::new(&buf);
21724 Self::arbitrary(&mut unstructured).unwrap_or_default()
21725 }
21726}
21727impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21728 fn default() -> Self {
21729 Self::DEFAULT.clone()
21730 }
21731}
21732impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21733 type Message = MavMessage;
21734 const ID: u32 = 12902u32;
21735 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21736 const EXTRA_CRC: u8 = 140u8;
21737 const ENCODED_LEN: usize = 53usize;
21738 fn deser(
21739 _version: MavlinkVersion,
21740 __input: &[u8],
21741 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21742 let avail_len = __input.len();
21743 let mut payload_buf = [0; Self::ENCODED_LEN];
21744 let mut buf = if avail_len < Self::ENCODED_LEN {
21745 payload_buf[0..avail_len].copy_from_slice(__input);
21746 Bytes::new(&payload_buf)
21747 } else {
21748 Bytes::new(__input)
21749 };
21750 let mut __struct = Self::default();
21751 __struct.timestamp = buf.get_u32_le();
21752 __struct.target_system = buf.get_u8();
21753 __struct.target_component = buf.get_u8();
21754 for v in &mut __struct.id_or_mac {
21755 let val = buf.get_u8();
21756 *v = val;
21757 }
21758 let tmp = buf.get_u8();
21759 __struct.authentication_type =
21760 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21761 enum_type: "MavOdidAuthType",
21762 value: tmp as u32,
21763 })?;
21764 __struct.data_page = buf.get_u8();
21765 __struct.last_page_index = buf.get_u8();
21766 __struct.length = buf.get_u8();
21767 for v in &mut __struct.authentication_data {
21768 let val = buf.get_u8();
21769 *v = val;
21770 }
21771 Ok(__struct)
21772 }
21773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21774 let mut __tmp = BytesMut::new(bytes);
21775 #[allow(clippy::absurd_extreme_comparisons)]
21776 #[allow(unused_comparisons)]
21777 if __tmp.remaining() < Self::ENCODED_LEN {
21778 panic!(
21779 "buffer is too small (need {} bytes, but got {})",
21780 Self::ENCODED_LEN,
21781 __tmp.remaining(),
21782 )
21783 }
21784 __tmp.put_u32_le(self.timestamp);
21785 __tmp.put_u8(self.target_system);
21786 __tmp.put_u8(self.target_component);
21787 for val in &self.id_or_mac {
21788 __tmp.put_u8(*val);
21789 }
21790 __tmp.put_u8(self.authentication_type as u8);
21791 __tmp.put_u8(self.data_page);
21792 __tmp.put_u8(self.last_page_index);
21793 __tmp.put_u8(self.length);
21794 for val in &self.authentication_data {
21795 __tmp.put_u8(*val);
21796 }
21797 if matches!(version, MavlinkVersion::V2) {
21798 let len = __tmp.len();
21799 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21800 } else {
21801 __tmp.len()
21802 }
21803 }
21804}
21805#[doc = "id: 12900"]
21806#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21807#[derive(Debug, Clone, PartialEq)]
21808#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21809#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21810pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21811 #[doc = "System ID (0 for broadcast)."]
21812 pub target_system: u8,
21813 #[doc = "Component ID (0 for broadcast)."]
21814 pub target_component: u8,
21815 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21816 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21817 pub id_or_mac: [u8; 20],
21818 #[doc = "Indicates the format for the uas_id field of this message."]
21819 pub id_type: MavOdidIdType,
21820 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21821 pub ua_type: MavOdidUaType,
21822 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21823 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21824 pub uas_id: [u8; 20],
21825}
21826impl OPEN_DRONE_ID_BASIC_ID_DATA {
21827 pub const ENCODED_LEN: usize = 44usize;
21828 pub const DEFAULT: Self = Self {
21829 target_system: 0_u8,
21830 target_component: 0_u8,
21831 id_or_mac: [0_u8; 20usize],
21832 id_type: MavOdidIdType::DEFAULT,
21833 ua_type: MavOdidUaType::DEFAULT,
21834 uas_id: [0_u8; 20usize],
21835 };
21836 #[cfg(feature = "arbitrary")]
21837 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21838 use arbitrary::{Arbitrary, Unstructured};
21839 let mut buf = [0u8; 1024];
21840 rng.fill_bytes(&mut buf);
21841 let mut unstructured = Unstructured::new(&buf);
21842 Self::arbitrary(&mut unstructured).unwrap_or_default()
21843 }
21844}
21845impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21846 fn default() -> Self {
21847 Self::DEFAULT.clone()
21848 }
21849}
21850impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21851 type Message = MavMessage;
21852 const ID: u32 = 12900u32;
21853 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21854 const EXTRA_CRC: u8 = 114u8;
21855 const ENCODED_LEN: usize = 44usize;
21856 fn deser(
21857 _version: MavlinkVersion,
21858 __input: &[u8],
21859 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21860 let avail_len = __input.len();
21861 let mut payload_buf = [0; Self::ENCODED_LEN];
21862 let mut buf = if avail_len < Self::ENCODED_LEN {
21863 payload_buf[0..avail_len].copy_from_slice(__input);
21864 Bytes::new(&payload_buf)
21865 } else {
21866 Bytes::new(__input)
21867 };
21868 let mut __struct = Self::default();
21869 __struct.target_system = buf.get_u8();
21870 __struct.target_component = buf.get_u8();
21871 for v in &mut __struct.id_or_mac {
21872 let val = buf.get_u8();
21873 *v = val;
21874 }
21875 let tmp = buf.get_u8();
21876 __struct.id_type =
21877 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21878 enum_type: "MavOdidIdType",
21879 value: tmp as u32,
21880 })?;
21881 let tmp = buf.get_u8();
21882 __struct.ua_type =
21883 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21884 enum_type: "MavOdidUaType",
21885 value: tmp as u32,
21886 })?;
21887 for v in &mut __struct.uas_id {
21888 let val = buf.get_u8();
21889 *v = val;
21890 }
21891 Ok(__struct)
21892 }
21893 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21894 let mut __tmp = BytesMut::new(bytes);
21895 #[allow(clippy::absurd_extreme_comparisons)]
21896 #[allow(unused_comparisons)]
21897 if __tmp.remaining() < Self::ENCODED_LEN {
21898 panic!(
21899 "buffer is too small (need {} bytes, but got {})",
21900 Self::ENCODED_LEN,
21901 __tmp.remaining(),
21902 )
21903 }
21904 __tmp.put_u8(self.target_system);
21905 __tmp.put_u8(self.target_component);
21906 for val in &self.id_or_mac {
21907 __tmp.put_u8(*val);
21908 }
21909 __tmp.put_u8(self.id_type as u8);
21910 __tmp.put_u8(self.ua_type as u8);
21911 for val in &self.uas_id {
21912 __tmp.put_u8(*val);
21913 }
21914 if matches!(version, MavlinkVersion::V2) {
21915 let len = __tmp.len();
21916 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21917 } else {
21918 __tmp.len()
21919 }
21920 }
21921}
21922#[doc = "id: 12901"]
21923#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21924#[derive(Debug, Clone, PartialEq)]
21925#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21926#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21927pub struct OPEN_DRONE_ID_LOCATION_DATA {
21928 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21929 pub latitude: i32,
21930 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21931 pub longitude: i32,
21932 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21933 pub altitude_barometric: f32,
21934 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21935 pub altitude_geodetic: f32,
21936 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21937 pub height: f32,
21938 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21939 pub timestamp: f32,
21940 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21941 pub direction: u16,
21942 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21943 pub speed_horizontal: u16,
21944 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21945 pub speed_vertical: i16,
21946 #[doc = "System ID (0 for broadcast)."]
21947 pub target_system: u8,
21948 #[doc = "Component ID (0 for broadcast)."]
21949 pub target_component: u8,
21950 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21951 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21952 pub id_or_mac: [u8; 20],
21953 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
21954 pub status: MavOdidStatus,
21955 #[doc = "Indicates the reference point for the height field."]
21956 pub height_reference: MavOdidHeightRef,
21957 #[doc = "The accuracy of the horizontal position."]
21958 pub horizontal_accuracy: MavOdidHorAcc,
21959 #[doc = "The accuracy of the vertical position."]
21960 pub vertical_accuracy: MavOdidVerAcc,
21961 #[doc = "The accuracy of the barometric altitude."]
21962 pub barometer_accuracy: MavOdidVerAcc,
21963 #[doc = "The accuracy of the horizontal and vertical speed."]
21964 pub speed_accuracy: MavOdidSpeedAcc,
21965 #[doc = "The accuracy of the timestamps."]
21966 pub timestamp_accuracy: MavOdidTimeAcc,
21967}
21968impl OPEN_DRONE_ID_LOCATION_DATA {
21969 pub const ENCODED_LEN: usize = 59usize;
21970 pub const DEFAULT: Self = Self {
21971 latitude: 0_i32,
21972 longitude: 0_i32,
21973 altitude_barometric: 0.0_f32,
21974 altitude_geodetic: 0.0_f32,
21975 height: 0.0_f32,
21976 timestamp: 0.0_f32,
21977 direction: 0_u16,
21978 speed_horizontal: 0_u16,
21979 speed_vertical: 0_i16,
21980 target_system: 0_u8,
21981 target_component: 0_u8,
21982 id_or_mac: [0_u8; 20usize],
21983 status: MavOdidStatus::DEFAULT,
21984 height_reference: MavOdidHeightRef::DEFAULT,
21985 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
21986 vertical_accuracy: MavOdidVerAcc::DEFAULT,
21987 barometer_accuracy: MavOdidVerAcc::DEFAULT,
21988 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
21989 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
21990 };
21991 #[cfg(feature = "arbitrary")]
21992 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21993 use arbitrary::{Arbitrary, Unstructured};
21994 let mut buf = [0u8; 1024];
21995 rng.fill_bytes(&mut buf);
21996 let mut unstructured = Unstructured::new(&buf);
21997 Self::arbitrary(&mut unstructured).unwrap_or_default()
21998 }
21999}
22000impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22001 fn default() -> Self {
22002 Self::DEFAULT.clone()
22003 }
22004}
22005impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22006 type Message = MavMessage;
22007 const ID: u32 = 12901u32;
22008 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22009 const EXTRA_CRC: u8 = 254u8;
22010 const ENCODED_LEN: usize = 59usize;
22011 fn deser(
22012 _version: MavlinkVersion,
22013 __input: &[u8],
22014 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22015 let avail_len = __input.len();
22016 let mut payload_buf = [0; Self::ENCODED_LEN];
22017 let mut buf = if avail_len < Self::ENCODED_LEN {
22018 payload_buf[0..avail_len].copy_from_slice(__input);
22019 Bytes::new(&payload_buf)
22020 } else {
22021 Bytes::new(__input)
22022 };
22023 let mut __struct = Self::default();
22024 __struct.latitude = buf.get_i32_le();
22025 __struct.longitude = buf.get_i32_le();
22026 __struct.altitude_barometric = buf.get_f32_le();
22027 __struct.altitude_geodetic = buf.get_f32_le();
22028 __struct.height = buf.get_f32_le();
22029 __struct.timestamp = buf.get_f32_le();
22030 __struct.direction = buf.get_u16_le();
22031 __struct.speed_horizontal = buf.get_u16_le();
22032 __struct.speed_vertical = buf.get_i16_le();
22033 __struct.target_system = buf.get_u8();
22034 __struct.target_component = buf.get_u8();
22035 for v in &mut __struct.id_or_mac {
22036 let val = buf.get_u8();
22037 *v = val;
22038 }
22039 let tmp = buf.get_u8();
22040 __struct.status =
22041 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22042 enum_type: "MavOdidStatus",
22043 value: tmp as u32,
22044 })?;
22045 let tmp = buf.get_u8();
22046 __struct.height_reference =
22047 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22048 enum_type: "MavOdidHeightRef",
22049 value: tmp as u32,
22050 })?;
22051 let tmp = buf.get_u8();
22052 __struct.horizontal_accuracy =
22053 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22054 enum_type: "MavOdidHorAcc",
22055 value: tmp as u32,
22056 })?;
22057 let tmp = buf.get_u8();
22058 __struct.vertical_accuracy =
22059 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22060 enum_type: "MavOdidVerAcc",
22061 value: tmp as u32,
22062 })?;
22063 let tmp = buf.get_u8();
22064 __struct.barometer_accuracy =
22065 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22066 enum_type: "MavOdidVerAcc",
22067 value: tmp as u32,
22068 })?;
22069 let tmp = buf.get_u8();
22070 __struct.speed_accuracy =
22071 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22072 enum_type: "MavOdidSpeedAcc",
22073 value: tmp as u32,
22074 })?;
22075 let tmp = buf.get_u8();
22076 __struct.timestamp_accuracy =
22077 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22078 enum_type: "MavOdidTimeAcc",
22079 value: tmp as u32,
22080 })?;
22081 Ok(__struct)
22082 }
22083 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22084 let mut __tmp = BytesMut::new(bytes);
22085 #[allow(clippy::absurd_extreme_comparisons)]
22086 #[allow(unused_comparisons)]
22087 if __tmp.remaining() < Self::ENCODED_LEN {
22088 panic!(
22089 "buffer is too small (need {} bytes, but got {})",
22090 Self::ENCODED_LEN,
22091 __tmp.remaining(),
22092 )
22093 }
22094 __tmp.put_i32_le(self.latitude);
22095 __tmp.put_i32_le(self.longitude);
22096 __tmp.put_f32_le(self.altitude_barometric);
22097 __tmp.put_f32_le(self.altitude_geodetic);
22098 __tmp.put_f32_le(self.height);
22099 __tmp.put_f32_le(self.timestamp);
22100 __tmp.put_u16_le(self.direction);
22101 __tmp.put_u16_le(self.speed_horizontal);
22102 __tmp.put_i16_le(self.speed_vertical);
22103 __tmp.put_u8(self.target_system);
22104 __tmp.put_u8(self.target_component);
22105 for val in &self.id_or_mac {
22106 __tmp.put_u8(*val);
22107 }
22108 __tmp.put_u8(self.status as u8);
22109 __tmp.put_u8(self.height_reference as u8);
22110 __tmp.put_u8(self.horizontal_accuracy as u8);
22111 __tmp.put_u8(self.vertical_accuracy as u8);
22112 __tmp.put_u8(self.barometer_accuracy as u8);
22113 __tmp.put_u8(self.speed_accuracy as u8);
22114 __tmp.put_u8(self.timestamp_accuracy as u8);
22115 if matches!(version, MavlinkVersion::V2) {
22116 let len = __tmp.len();
22117 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22118 } else {
22119 __tmp.len()
22120 }
22121 }
22122}
22123#[doc = "id: 12915"]
22124#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22125#[derive(Debug, Clone, PartialEq)]
22126#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22127#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22128pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22129 #[doc = "System ID (0 for broadcast)."]
22130 pub target_system: u8,
22131 #[doc = "Component ID (0 for broadcast)."]
22132 pub target_component: u8,
22133 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22134 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22135 pub id_or_mac: [u8; 20],
22136 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22137 pub single_message_size: u8,
22138 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22139 pub msg_pack_size: u8,
22140 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22141 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22142 pub messages: [u8; 225],
22143}
22144impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22145 pub const ENCODED_LEN: usize = 249usize;
22146 pub const DEFAULT: Self = Self {
22147 target_system: 0_u8,
22148 target_component: 0_u8,
22149 id_or_mac: [0_u8; 20usize],
22150 single_message_size: 0_u8,
22151 msg_pack_size: 0_u8,
22152 messages: [0_u8; 225usize],
22153 };
22154 #[cfg(feature = "arbitrary")]
22155 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22156 use arbitrary::{Arbitrary, Unstructured};
22157 let mut buf = [0u8; 1024];
22158 rng.fill_bytes(&mut buf);
22159 let mut unstructured = Unstructured::new(&buf);
22160 Self::arbitrary(&mut unstructured).unwrap_or_default()
22161 }
22162}
22163impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22164 fn default() -> Self {
22165 Self::DEFAULT.clone()
22166 }
22167}
22168impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22169 type Message = MavMessage;
22170 const ID: u32 = 12915u32;
22171 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22172 const EXTRA_CRC: u8 = 94u8;
22173 const ENCODED_LEN: usize = 249usize;
22174 fn deser(
22175 _version: MavlinkVersion,
22176 __input: &[u8],
22177 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22178 let avail_len = __input.len();
22179 let mut payload_buf = [0; Self::ENCODED_LEN];
22180 let mut buf = if avail_len < Self::ENCODED_LEN {
22181 payload_buf[0..avail_len].copy_from_slice(__input);
22182 Bytes::new(&payload_buf)
22183 } else {
22184 Bytes::new(__input)
22185 };
22186 let mut __struct = Self::default();
22187 __struct.target_system = buf.get_u8();
22188 __struct.target_component = buf.get_u8();
22189 for v in &mut __struct.id_or_mac {
22190 let val = buf.get_u8();
22191 *v = val;
22192 }
22193 __struct.single_message_size = buf.get_u8();
22194 __struct.msg_pack_size = buf.get_u8();
22195 for v in &mut __struct.messages {
22196 let val = buf.get_u8();
22197 *v = val;
22198 }
22199 Ok(__struct)
22200 }
22201 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22202 let mut __tmp = BytesMut::new(bytes);
22203 #[allow(clippy::absurd_extreme_comparisons)]
22204 #[allow(unused_comparisons)]
22205 if __tmp.remaining() < Self::ENCODED_LEN {
22206 panic!(
22207 "buffer is too small (need {} bytes, but got {})",
22208 Self::ENCODED_LEN,
22209 __tmp.remaining(),
22210 )
22211 }
22212 __tmp.put_u8(self.target_system);
22213 __tmp.put_u8(self.target_component);
22214 for val in &self.id_or_mac {
22215 __tmp.put_u8(*val);
22216 }
22217 __tmp.put_u8(self.single_message_size);
22218 __tmp.put_u8(self.msg_pack_size);
22219 for val in &self.messages {
22220 __tmp.put_u8(*val);
22221 }
22222 if matches!(version, MavlinkVersion::V2) {
22223 let len = __tmp.len();
22224 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22225 } else {
22226 __tmp.len()
22227 }
22228 }
22229}
22230#[doc = "id: 12905"]
22231#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22232#[derive(Debug, Clone, PartialEq)]
22233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22234#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22235pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22236 #[doc = "System ID (0 for broadcast)."]
22237 pub target_system: u8,
22238 #[doc = "Component ID (0 for broadcast)."]
22239 pub target_component: u8,
22240 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22241 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22242 pub id_or_mac: [u8; 20],
22243 #[doc = "Indicates the type of the operator_id field."]
22244 pub operator_id_type: MavOdidOperatorIdType,
22245 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22246 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22247 pub operator_id: [u8; 20],
22248}
22249impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22250 pub const ENCODED_LEN: usize = 43usize;
22251 pub const DEFAULT: Self = Self {
22252 target_system: 0_u8,
22253 target_component: 0_u8,
22254 id_or_mac: [0_u8; 20usize],
22255 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22256 operator_id: [0_u8; 20usize],
22257 };
22258 #[cfg(feature = "arbitrary")]
22259 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22260 use arbitrary::{Arbitrary, Unstructured};
22261 let mut buf = [0u8; 1024];
22262 rng.fill_bytes(&mut buf);
22263 let mut unstructured = Unstructured::new(&buf);
22264 Self::arbitrary(&mut unstructured).unwrap_or_default()
22265 }
22266}
22267impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22268 fn default() -> Self {
22269 Self::DEFAULT.clone()
22270 }
22271}
22272impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22273 type Message = MavMessage;
22274 const ID: u32 = 12905u32;
22275 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22276 const EXTRA_CRC: u8 = 49u8;
22277 const ENCODED_LEN: usize = 43usize;
22278 fn deser(
22279 _version: MavlinkVersion,
22280 __input: &[u8],
22281 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22282 let avail_len = __input.len();
22283 let mut payload_buf = [0; Self::ENCODED_LEN];
22284 let mut buf = if avail_len < Self::ENCODED_LEN {
22285 payload_buf[0..avail_len].copy_from_slice(__input);
22286 Bytes::new(&payload_buf)
22287 } else {
22288 Bytes::new(__input)
22289 };
22290 let mut __struct = Self::default();
22291 __struct.target_system = buf.get_u8();
22292 __struct.target_component = buf.get_u8();
22293 for v in &mut __struct.id_or_mac {
22294 let val = buf.get_u8();
22295 *v = val;
22296 }
22297 let tmp = buf.get_u8();
22298 __struct.operator_id_type =
22299 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22300 enum_type: "MavOdidOperatorIdType",
22301 value: tmp as u32,
22302 })?;
22303 for v in &mut __struct.operator_id {
22304 let val = buf.get_u8();
22305 *v = val;
22306 }
22307 Ok(__struct)
22308 }
22309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22310 let mut __tmp = BytesMut::new(bytes);
22311 #[allow(clippy::absurd_extreme_comparisons)]
22312 #[allow(unused_comparisons)]
22313 if __tmp.remaining() < Self::ENCODED_LEN {
22314 panic!(
22315 "buffer is too small (need {} bytes, but got {})",
22316 Self::ENCODED_LEN,
22317 __tmp.remaining(),
22318 )
22319 }
22320 __tmp.put_u8(self.target_system);
22321 __tmp.put_u8(self.target_component);
22322 for val in &self.id_or_mac {
22323 __tmp.put_u8(*val);
22324 }
22325 __tmp.put_u8(self.operator_id_type as u8);
22326 for val in &self.operator_id {
22327 __tmp.put_u8(*val);
22328 }
22329 if matches!(version, MavlinkVersion::V2) {
22330 let len = __tmp.len();
22331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22332 } else {
22333 __tmp.len()
22334 }
22335 }
22336}
22337#[doc = "id: 12903"]
22338#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22339#[derive(Debug, Clone, PartialEq)]
22340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22342pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22343 #[doc = "System ID (0 for broadcast)."]
22344 pub target_system: u8,
22345 #[doc = "Component ID (0 for broadcast)."]
22346 pub target_component: u8,
22347 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22348 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22349 pub id_or_mac: [u8; 20],
22350 #[doc = "Indicates the type of the description field."]
22351 pub description_type: MavOdidDescType,
22352 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22353 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22354 pub description: [u8; 23],
22355}
22356impl OPEN_DRONE_ID_SELF_ID_DATA {
22357 pub const ENCODED_LEN: usize = 46usize;
22358 pub const DEFAULT: Self = Self {
22359 target_system: 0_u8,
22360 target_component: 0_u8,
22361 id_or_mac: [0_u8; 20usize],
22362 description_type: MavOdidDescType::DEFAULT,
22363 description: [0_u8; 23usize],
22364 };
22365 #[cfg(feature = "arbitrary")]
22366 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22367 use arbitrary::{Arbitrary, Unstructured};
22368 let mut buf = [0u8; 1024];
22369 rng.fill_bytes(&mut buf);
22370 let mut unstructured = Unstructured::new(&buf);
22371 Self::arbitrary(&mut unstructured).unwrap_or_default()
22372 }
22373}
22374impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22375 fn default() -> Self {
22376 Self::DEFAULT.clone()
22377 }
22378}
22379impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22380 type Message = MavMessage;
22381 const ID: u32 = 12903u32;
22382 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22383 const EXTRA_CRC: u8 = 249u8;
22384 const ENCODED_LEN: usize = 46usize;
22385 fn deser(
22386 _version: MavlinkVersion,
22387 __input: &[u8],
22388 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22389 let avail_len = __input.len();
22390 let mut payload_buf = [0; Self::ENCODED_LEN];
22391 let mut buf = if avail_len < Self::ENCODED_LEN {
22392 payload_buf[0..avail_len].copy_from_slice(__input);
22393 Bytes::new(&payload_buf)
22394 } else {
22395 Bytes::new(__input)
22396 };
22397 let mut __struct = Self::default();
22398 __struct.target_system = buf.get_u8();
22399 __struct.target_component = buf.get_u8();
22400 for v in &mut __struct.id_or_mac {
22401 let val = buf.get_u8();
22402 *v = val;
22403 }
22404 let tmp = buf.get_u8();
22405 __struct.description_type =
22406 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22407 enum_type: "MavOdidDescType",
22408 value: tmp as u32,
22409 })?;
22410 for v in &mut __struct.description {
22411 let val = buf.get_u8();
22412 *v = val;
22413 }
22414 Ok(__struct)
22415 }
22416 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22417 let mut __tmp = BytesMut::new(bytes);
22418 #[allow(clippy::absurd_extreme_comparisons)]
22419 #[allow(unused_comparisons)]
22420 if __tmp.remaining() < Self::ENCODED_LEN {
22421 panic!(
22422 "buffer is too small (need {} bytes, but got {})",
22423 Self::ENCODED_LEN,
22424 __tmp.remaining(),
22425 )
22426 }
22427 __tmp.put_u8(self.target_system);
22428 __tmp.put_u8(self.target_component);
22429 for val in &self.id_or_mac {
22430 __tmp.put_u8(*val);
22431 }
22432 __tmp.put_u8(self.description_type as u8);
22433 for val in &self.description {
22434 __tmp.put_u8(*val);
22435 }
22436 if matches!(version, MavlinkVersion::V2) {
22437 let len = __tmp.len();
22438 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22439 } else {
22440 __tmp.len()
22441 }
22442 }
22443}
22444#[doc = "id: 12904"]
22445#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22446#[derive(Debug, Clone, PartialEq)]
22447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22449pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22450 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22451 pub operator_latitude: i32,
22452 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22453 pub operator_longitude: i32,
22454 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22455 pub area_ceiling: f32,
22456 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22457 pub area_floor: f32,
22458 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22459 pub operator_altitude_geo: f32,
22460 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22461 pub timestamp: u32,
22462 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22463 pub area_count: u16,
22464 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22465 pub area_radius: u16,
22466 #[doc = "System ID (0 for broadcast)."]
22467 pub target_system: u8,
22468 #[doc = "Component ID (0 for broadcast)."]
22469 pub target_component: u8,
22470 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22471 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22472 pub id_or_mac: [u8; 20],
22473 #[doc = "Specifies the operator location type."]
22474 pub operator_location_type: MavOdidOperatorLocationType,
22475 #[doc = "Specifies the classification type of the UA."]
22476 pub classification_type: MavOdidClassificationType,
22477 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22478 pub category_eu: MavOdidCategoryEu,
22479 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22480 pub class_eu: MavOdidClassEu,
22481}
22482impl OPEN_DRONE_ID_SYSTEM_DATA {
22483 pub const ENCODED_LEN: usize = 54usize;
22484 pub const DEFAULT: Self = Self {
22485 operator_latitude: 0_i32,
22486 operator_longitude: 0_i32,
22487 area_ceiling: 0.0_f32,
22488 area_floor: 0.0_f32,
22489 operator_altitude_geo: 0.0_f32,
22490 timestamp: 0_u32,
22491 area_count: 0_u16,
22492 area_radius: 0_u16,
22493 target_system: 0_u8,
22494 target_component: 0_u8,
22495 id_or_mac: [0_u8; 20usize],
22496 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22497 classification_type: MavOdidClassificationType::DEFAULT,
22498 category_eu: MavOdidCategoryEu::DEFAULT,
22499 class_eu: MavOdidClassEu::DEFAULT,
22500 };
22501 #[cfg(feature = "arbitrary")]
22502 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22503 use arbitrary::{Arbitrary, Unstructured};
22504 let mut buf = [0u8; 1024];
22505 rng.fill_bytes(&mut buf);
22506 let mut unstructured = Unstructured::new(&buf);
22507 Self::arbitrary(&mut unstructured).unwrap_or_default()
22508 }
22509}
22510impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22511 fn default() -> Self {
22512 Self::DEFAULT.clone()
22513 }
22514}
22515impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22516 type Message = MavMessage;
22517 const ID: u32 = 12904u32;
22518 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22519 const EXTRA_CRC: u8 = 77u8;
22520 const ENCODED_LEN: usize = 54usize;
22521 fn deser(
22522 _version: MavlinkVersion,
22523 __input: &[u8],
22524 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22525 let avail_len = __input.len();
22526 let mut payload_buf = [0; Self::ENCODED_LEN];
22527 let mut buf = if avail_len < Self::ENCODED_LEN {
22528 payload_buf[0..avail_len].copy_from_slice(__input);
22529 Bytes::new(&payload_buf)
22530 } else {
22531 Bytes::new(__input)
22532 };
22533 let mut __struct = Self::default();
22534 __struct.operator_latitude = buf.get_i32_le();
22535 __struct.operator_longitude = buf.get_i32_le();
22536 __struct.area_ceiling = buf.get_f32_le();
22537 __struct.area_floor = buf.get_f32_le();
22538 __struct.operator_altitude_geo = buf.get_f32_le();
22539 __struct.timestamp = buf.get_u32_le();
22540 __struct.area_count = buf.get_u16_le();
22541 __struct.area_radius = buf.get_u16_le();
22542 __struct.target_system = buf.get_u8();
22543 __struct.target_component = buf.get_u8();
22544 for v in &mut __struct.id_or_mac {
22545 let val = buf.get_u8();
22546 *v = val;
22547 }
22548 let tmp = buf.get_u8();
22549 __struct.operator_location_type =
22550 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22551 enum_type: "MavOdidOperatorLocationType",
22552 value: tmp as u32,
22553 })?;
22554 let tmp = buf.get_u8();
22555 __struct.classification_type =
22556 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22557 enum_type: "MavOdidClassificationType",
22558 value: tmp as u32,
22559 })?;
22560 let tmp = buf.get_u8();
22561 __struct.category_eu =
22562 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22563 enum_type: "MavOdidCategoryEu",
22564 value: tmp as u32,
22565 })?;
22566 let tmp = buf.get_u8();
22567 __struct.class_eu =
22568 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22569 enum_type: "MavOdidClassEu",
22570 value: tmp as u32,
22571 })?;
22572 Ok(__struct)
22573 }
22574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22575 let mut __tmp = BytesMut::new(bytes);
22576 #[allow(clippy::absurd_extreme_comparisons)]
22577 #[allow(unused_comparisons)]
22578 if __tmp.remaining() < Self::ENCODED_LEN {
22579 panic!(
22580 "buffer is too small (need {} bytes, but got {})",
22581 Self::ENCODED_LEN,
22582 __tmp.remaining(),
22583 )
22584 }
22585 __tmp.put_i32_le(self.operator_latitude);
22586 __tmp.put_i32_le(self.operator_longitude);
22587 __tmp.put_f32_le(self.area_ceiling);
22588 __tmp.put_f32_le(self.area_floor);
22589 __tmp.put_f32_le(self.operator_altitude_geo);
22590 __tmp.put_u32_le(self.timestamp);
22591 __tmp.put_u16_le(self.area_count);
22592 __tmp.put_u16_le(self.area_radius);
22593 __tmp.put_u8(self.target_system);
22594 __tmp.put_u8(self.target_component);
22595 for val in &self.id_or_mac {
22596 __tmp.put_u8(*val);
22597 }
22598 __tmp.put_u8(self.operator_location_type as u8);
22599 __tmp.put_u8(self.classification_type as u8);
22600 __tmp.put_u8(self.category_eu as u8);
22601 __tmp.put_u8(self.class_eu as u8);
22602 if matches!(version, MavlinkVersion::V2) {
22603 let len = __tmp.len();
22604 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22605 } else {
22606 __tmp.len()
22607 }
22608 }
22609}
22610#[doc = "id: 12919"]
22611#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22612#[derive(Debug, Clone, PartialEq)]
22613#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22614#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22615pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22616 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22617 pub operator_latitude: i32,
22618 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22619 pub operator_longitude: i32,
22620 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22621 pub operator_altitude_geo: f32,
22622 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22623 pub timestamp: u32,
22624 #[doc = "System ID (0 for broadcast)."]
22625 pub target_system: u8,
22626 #[doc = "Component ID (0 for broadcast)."]
22627 pub target_component: u8,
22628}
22629impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22630 pub const ENCODED_LEN: usize = 18usize;
22631 pub const DEFAULT: Self = Self {
22632 operator_latitude: 0_i32,
22633 operator_longitude: 0_i32,
22634 operator_altitude_geo: 0.0_f32,
22635 timestamp: 0_u32,
22636 target_system: 0_u8,
22637 target_component: 0_u8,
22638 };
22639 #[cfg(feature = "arbitrary")]
22640 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22641 use arbitrary::{Arbitrary, Unstructured};
22642 let mut buf = [0u8; 1024];
22643 rng.fill_bytes(&mut buf);
22644 let mut unstructured = Unstructured::new(&buf);
22645 Self::arbitrary(&mut unstructured).unwrap_or_default()
22646 }
22647}
22648impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22649 fn default() -> Self {
22650 Self::DEFAULT.clone()
22651 }
22652}
22653impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22654 type Message = MavMessage;
22655 const ID: u32 = 12919u32;
22656 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22657 const EXTRA_CRC: u8 = 7u8;
22658 const ENCODED_LEN: usize = 18usize;
22659 fn deser(
22660 _version: MavlinkVersion,
22661 __input: &[u8],
22662 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22663 let avail_len = __input.len();
22664 let mut payload_buf = [0; Self::ENCODED_LEN];
22665 let mut buf = if avail_len < Self::ENCODED_LEN {
22666 payload_buf[0..avail_len].copy_from_slice(__input);
22667 Bytes::new(&payload_buf)
22668 } else {
22669 Bytes::new(__input)
22670 };
22671 let mut __struct = Self::default();
22672 __struct.operator_latitude = buf.get_i32_le();
22673 __struct.operator_longitude = buf.get_i32_le();
22674 __struct.operator_altitude_geo = buf.get_f32_le();
22675 __struct.timestamp = buf.get_u32_le();
22676 __struct.target_system = buf.get_u8();
22677 __struct.target_component = buf.get_u8();
22678 Ok(__struct)
22679 }
22680 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22681 let mut __tmp = BytesMut::new(bytes);
22682 #[allow(clippy::absurd_extreme_comparisons)]
22683 #[allow(unused_comparisons)]
22684 if __tmp.remaining() < Self::ENCODED_LEN {
22685 panic!(
22686 "buffer is too small (need {} bytes, but got {})",
22687 Self::ENCODED_LEN,
22688 __tmp.remaining(),
22689 )
22690 }
22691 __tmp.put_i32_le(self.operator_latitude);
22692 __tmp.put_i32_le(self.operator_longitude);
22693 __tmp.put_f32_le(self.operator_altitude_geo);
22694 __tmp.put_u32_le(self.timestamp);
22695 __tmp.put_u8(self.target_system);
22696 __tmp.put_u8(self.target_component);
22697 if matches!(version, MavlinkVersion::V2) {
22698 let len = __tmp.len();
22699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22700 } else {
22701 __tmp.len()
22702 }
22703 }
22704}
22705#[doc = "id: 100"]
22706#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22707#[derive(Debug, Clone, PartialEq)]
22708#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22709#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22710pub struct OPTICAL_FLOW_DATA {
22711 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22712 pub time_usec: u64,
22713 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22714 pub flow_comp_m_x: f32,
22715 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22716 pub flow_comp_m_y: f32,
22717 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22718 pub ground_distance: f32,
22719 #[doc = "Flow in x-sensor direction"]
22720 pub flow_x: i16,
22721 #[doc = "Flow in y-sensor direction"]
22722 pub flow_y: i16,
22723 #[doc = "Sensor ID"]
22724 pub sensor_id: u8,
22725 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
22726 pub quality: u8,
22727 #[doc = "Flow rate about X axis"]
22728 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22729 pub flow_rate_x: f32,
22730 #[doc = "Flow rate about Y axis"]
22731 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22732 pub flow_rate_y: f32,
22733}
22734impl OPTICAL_FLOW_DATA {
22735 pub const ENCODED_LEN: usize = 34usize;
22736 pub const DEFAULT: Self = Self {
22737 time_usec: 0_u64,
22738 flow_comp_m_x: 0.0_f32,
22739 flow_comp_m_y: 0.0_f32,
22740 ground_distance: 0.0_f32,
22741 flow_x: 0_i16,
22742 flow_y: 0_i16,
22743 sensor_id: 0_u8,
22744 quality: 0_u8,
22745 flow_rate_x: 0.0_f32,
22746 flow_rate_y: 0.0_f32,
22747 };
22748 #[cfg(feature = "arbitrary")]
22749 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22750 use arbitrary::{Arbitrary, Unstructured};
22751 let mut buf = [0u8; 1024];
22752 rng.fill_bytes(&mut buf);
22753 let mut unstructured = Unstructured::new(&buf);
22754 Self::arbitrary(&mut unstructured).unwrap_or_default()
22755 }
22756}
22757impl Default for OPTICAL_FLOW_DATA {
22758 fn default() -> Self {
22759 Self::DEFAULT.clone()
22760 }
22761}
22762impl MessageData for OPTICAL_FLOW_DATA {
22763 type Message = MavMessage;
22764 const ID: u32 = 100u32;
22765 const NAME: &'static str = "OPTICAL_FLOW";
22766 const EXTRA_CRC: u8 = 175u8;
22767 const ENCODED_LEN: usize = 34usize;
22768 fn deser(
22769 _version: MavlinkVersion,
22770 __input: &[u8],
22771 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22772 let avail_len = __input.len();
22773 let mut payload_buf = [0; Self::ENCODED_LEN];
22774 let mut buf = if avail_len < Self::ENCODED_LEN {
22775 payload_buf[0..avail_len].copy_from_slice(__input);
22776 Bytes::new(&payload_buf)
22777 } else {
22778 Bytes::new(__input)
22779 };
22780 let mut __struct = Self::default();
22781 __struct.time_usec = buf.get_u64_le();
22782 __struct.flow_comp_m_x = buf.get_f32_le();
22783 __struct.flow_comp_m_y = buf.get_f32_le();
22784 __struct.ground_distance = buf.get_f32_le();
22785 __struct.flow_x = buf.get_i16_le();
22786 __struct.flow_y = buf.get_i16_le();
22787 __struct.sensor_id = buf.get_u8();
22788 __struct.quality = buf.get_u8();
22789 __struct.flow_rate_x = buf.get_f32_le();
22790 __struct.flow_rate_y = buf.get_f32_le();
22791 Ok(__struct)
22792 }
22793 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22794 let mut __tmp = BytesMut::new(bytes);
22795 #[allow(clippy::absurd_extreme_comparisons)]
22796 #[allow(unused_comparisons)]
22797 if __tmp.remaining() < Self::ENCODED_LEN {
22798 panic!(
22799 "buffer is too small (need {} bytes, but got {})",
22800 Self::ENCODED_LEN,
22801 __tmp.remaining(),
22802 )
22803 }
22804 __tmp.put_u64_le(self.time_usec);
22805 __tmp.put_f32_le(self.flow_comp_m_x);
22806 __tmp.put_f32_le(self.flow_comp_m_y);
22807 __tmp.put_f32_le(self.ground_distance);
22808 __tmp.put_i16_le(self.flow_x);
22809 __tmp.put_i16_le(self.flow_y);
22810 __tmp.put_u8(self.sensor_id);
22811 __tmp.put_u8(self.quality);
22812 __tmp.put_f32_le(self.flow_rate_x);
22813 __tmp.put_f32_le(self.flow_rate_y);
22814 if matches!(version, MavlinkVersion::V2) {
22815 let len = __tmp.len();
22816 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22817 } else {
22818 __tmp.len()
22819 }
22820 }
22821}
22822#[doc = "id: 106"]
22823#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22824#[derive(Debug, Clone, PartialEq)]
22825#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22826#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22827pub struct OPTICAL_FLOW_RAD_DATA {
22828 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22829 pub time_usec: u64,
22830 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22831 pub integration_time_us: u32,
22832 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22833 pub integrated_x: f32,
22834 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22835 pub integrated_y: f32,
22836 #[doc = "RH rotation around X axis"]
22837 pub integrated_xgyro: f32,
22838 #[doc = "RH rotation around Y axis"]
22839 pub integrated_ygyro: f32,
22840 #[doc = "RH rotation around Z axis"]
22841 pub integrated_zgyro: f32,
22842 #[doc = "Time since the distance was sampled."]
22843 pub time_delta_distance_us: u32,
22844 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22845 pub distance: f32,
22846 #[doc = "Temperature"]
22847 pub temperature: i16,
22848 #[doc = "Sensor ID"]
22849 pub sensor_id: u8,
22850 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22851 pub quality: u8,
22852}
22853impl OPTICAL_FLOW_RAD_DATA {
22854 pub const ENCODED_LEN: usize = 44usize;
22855 pub const DEFAULT: Self = Self {
22856 time_usec: 0_u64,
22857 integration_time_us: 0_u32,
22858 integrated_x: 0.0_f32,
22859 integrated_y: 0.0_f32,
22860 integrated_xgyro: 0.0_f32,
22861 integrated_ygyro: 0.0_f32,
22862 integrated_zgyro: 0.0_f32,
22863 time_delta_distance_us: 0_u32,
22864 distance: 0.0_f32,
22865 temperature: 0_i16,
22866 sensor_id: 0_u8,
22867 quality: 0_u8,
22868 };
22869 #[cfg(feature = "arbitrary")]
22870 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22871 use arbitrary::{Arbitrary, Unstructured};
22872 let mut buf = [0u8; 1024];
22873 rng.fill_bytes(&mut buf);
22874 let mut unstructured = Unstructured::new(&buf);
22875 Self::arbitrary(&mut unstructured).unwrap_or_default()
22876 }
22877}
22878impl Default for OPTICAL_FLOW_RAD_DATA {
22879 fn default() -> Self {
22880 Self::DEFAULT.clone()
22881 }
22882}
22883impl MessageData for OPTICAL_FLOW_RAD_DATA {
22884 type Message = MavMessage;
22885 const ID: u32 = 106u32;
22886 const NAME: &'static str = "OPTICAL_FLOW_RAD";
22887 const EXTRA_CRC: u8 = 138u8;
22888 const ENCODED_LEN: usize = 44usize;
22889 fn deser(
22890 _version: MavlinkVersion,
22891 __input: &[u8],
22892 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22893 let avail_len = __input.len();
22894 let mut payload_buf = [0; Self::ENCODED_LEN];
22895 let mut buf = if avail_len < Self::ENCODED_LEN {
22896 payload_buf[0..avail_len].copy_from_slice(__input);
22897 Bytes::new(&payload_buf)
22898 } else {
22899 Bytes::new(__input)
22900 };
22901 let mut __struct = Self::default();
22902 __struct.time_usec = buf.get_u64_le();
22903 __struct.integration_time_us = buf.get_u32_le();
22904 __struct.integrated_x = buf.get_f32_le();
22905 __struct.integrated_y = buf.get_f32_le();
22906 __struct.integrated_xgyro = buf.get_f32_le();
22907 __struct.integrated_ygyro = buf.get_f32_le();
22908 __struct.integrated_zgyro = buf.get_f32_le();
22909 __struct.time_delta_distance_us = buf.get_u32_le();
22910 __struct.distance = buf.get_f32_le();
22911 __struct.temperature = buf.get_i16_le();
22912 __struct.sensor_id = buf.get_u8();
22913 __struct.quality = buf.get_u8();
22914 Ok(__struct)
22915 }
22916 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22917 let mut __tmp = BytesMut::new(bytes);
22918 #[allow(clippy::absurd_extreme_comparisons)]
22919 #[allow(unused_comparisons)]
22920 if __tmp.remaining() < Self::ENCODED_LEN {
22921 panic!(
22922 "buffer is too small (need {} bytes, but got {})",
22923 Self::ENCODED_LEN,
22924 __tmp.remaining(),
22925 )
22926 }
22927 __tmp.put_u64_le(self.time_usec);
22928 __tmp.put_u32_le(self.integration_time_us);
22929 __tmp.put_f32_le(self.integrated_x);
22930 __tmp.put_f32_le(self.integrated_y);
22931 __tmp.put_f32_le(self.integrated_xgyro);
22932 __tmp.put_f32_le(self.integrated_ygyro);
22933 __tmp.put_f32_le(self.integrated_zgyro);
22934 __tmp.put_u32_le(self.time_delta_distance_us);
22935 __tmp.put_f32_le(self.distance);
22936 __tmp.put_i16_le(self.temperature);
22937 __tmp.put_u8(self.sensor_id);
22938 __tmp.put_u8(self.quality);
22939 if matches!(version, MavlinkVersion::V2) {
22940 let len = __tmp.len();
22941 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22942 } else {
22943 __tmp.len()
22944 }
22945 }
22946}
22947#[doc = "id: 360"]
22948#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
22949#[derive(Debug, Clone, PartialEq)]
22950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22952pub struct ORBIT_EXECUTION_STATUS_DATA {
22953 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22954 pub time_usec: u64,
22955 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
22956 pub radius: f32,
22957 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22958 pub x: i32,
22959 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22960 pub y: i32,
22961 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
22962 pub z: f32,
22963 #[doc = "The coordinate system of the fields: x, y, z."]
22964 pub frame: MavFrame,
22965}
22966impl ORBIT_EXECUTION_STATUS_DATA {
22967 pub const ENCODED_LEN: usize = 25usize;
22968 pub const DEFAULT: Self = Self {
22969 time_usec: 0_u64,
22970 radius: 0.0_f32,
22971 x: 0_i32,
22972 y: 0_i32,
22973 z: 0.0_f32,
22974 frame: MavFrame::DEFAULT,
22975 };
22976 #[cfg(feature = "arbitrary")]
22977 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22978 use arbitrary::{Arbitrary, Unstructured};
22979 let mut buf = [0u8; 1024];
22980 rng.fill_bytes(&mut buf);
22981 let mut unstructured = Unstructured::new(&buf);
22982 Self::arbitrary(&mut unstructured).unwrap_or_default()
22983 }
22984}
22985impl Default for ORBIT_EXECUTION_STATUS_DATA {
22986 fn default() -> Self {
22987 Self::DEFAULT.clone()
22988 }
22989}
22990impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
22991 type Message = MavMessage;
22992 const ID: u32 = 360u32;
22993 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
22994 const EXTRA_CRC: u8 = 11u8;
22995 const ENCODED_LEN: usize = 25usize;
22996 fn deser(
22997 _version: MavlinkVersion,
22998 __input: &[u8],
22999 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23000 let avail_len = __input.len();
23001 let mut payload_buf = [0; Self::ENCODED_LEN];
23002 let mut buf = if avail_len < Self::ENCODED_LEN {
23003 payload_buf[0..avail_len].copy_from_slice(__input);
23004 Bytes::new(&payload_buf)
23005 } else {
23006 Bytes::new(__input)
23007 };
23008 let mut __struct = Self::default();
23009 __struct.time_usec = buf.get_u64_le();
23010 __struct.radius = buf.get_f32_le();
23011 __struct.x = buf.get_i32_le();
23012 __struct.y = buf.get_i32_le();
23013 __struct.z = buf.get_f32_le();
23014 let tmp = buf.get_u8();
23015 __struct.frame =
23016 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23017 enum_type: "MavFrame",
23018 value: tmp as u32,
23019 })?;
23020 Ok(__struct)
23021 }
23022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23023 let mut __tmp = BytesMut::new(bytes);
23024 #[allow(clippy::absurd_extreme_comparisons)]
23025 #[allow(unused_comparisons)]
23026 if __tmp.remaining() < Self::ENCODED_LEN {
23027 panic!(
23028 "buffer is too small (need {} bytes, but got {})",
23029 Self::ENCODED_LEN,
23030 __tmp.remaining(),
23031 )
23032 }
23033 __tmp.put_u64_le(self.time_usec);
23034 __tmp.put_f32_le(self.radius);
23035 __tmp.put_i32_le(self.x);
23036 __tmp.put_i32_le(self.y);
23037 __tmp.put_f32_le(self.z);
23038 __tmp.put_u8(self.frame as u8);
23039 if matches!(version, MavlinkVersion::V2) {
23040 let len = __tmp.len();
23041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23042 } else {
23043 __tmp.len()
23044 }
23045 }
23046}
23047#[doc = "id: 324"]
23048#[doc = "Response from a PARAM_EXT_SET message."]
23049#[derive(Debug, Clone, PartialEq)]
23050#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23051#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23052pub struct PARAM_EXT_ACK_DATA {
23053 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23054 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23055 pub param_id: [u8; 16],
23056 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23057 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23058 pub param_value: [u8; 128],
23059 #[doc = "Parameter type."]
23060 pub param_type: MavParamExtType,
23061 #[doc = "Result code."]
23062 pub param_result: ParamAck,
23063}
23064impl PARAM_EXT_ACK_DATA {
23065 pub const ENCODED_LEN: usize = 146usize;
23066 pub const DEFAULT: Self = Self {
23067 param_id: [0_u8; 16usize],
23068 param_value: [0_u8; 128usize],
23069 param_type: MavParamExtType::DEFAULT,
23070 param_result: ParamAck::DEFAULT,
23071 };
23072 #[cfg(feature = "arbitrary")]
23073 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23074 use arbitrary::{Arbitrary, Unstructured};
23075 let mut buf = [0u8; 1024];
23076 rng.fill_bytes(&mut buf);
23077 let mut unstructured = Unstructured::new(&buf);
23078 Self::arbitrary(&mut unstructured).unwrap_or_default()
23079 }
23080}
23081impl Default for PARAM_EXT_ACK_DATA {
23082 fn default() -> Self {
23083 Self::DEFAULT.clone()
23084 }
23085}
23086impl MessageData for PARAM_EXT_ACK_DATA {
23087 type Message = MavMessage;
23088 const ID: u32 = 324u32;
23089 const NAME: &'static str = "PARAM_EXT_ACK";
23090 const EXTRA_CRC: u8 = 132u8;
23091 const ENCODED_LEN: usize = 146usize;
23092 fn deser(
23093 _version: MavlinkVersion,
23094 __input: &[u8],
23095 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23096 let avail_len = __input.len();
23097 let mut payload_buf = [0; Self::ENCODED_LEN];
23098 let mut buf = if avail_len < Self::ENCODED_LEN {
23099 payload_buf[0..avail_len].copy_from_slice(__input);
23100 Bytes::new(&payload_buf)
23101 } else {
23102 Bytes::new(__input)
23103 };
23104 let mut __struct = Self::default();
23105 for v in &mut __struct.param_id {
23106 let val = buf.get_u8();
23107 *v = val;
23108 }
23109 for v in &mut __struct.param_value {
23110 let val = buf.get_u8();
23111 *v = val;
23112 }
23113 let tmp = buf.get_u8();
23114 __struct.param_type =
23115 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23116 enum_type: "MavParamExtType",
23117 value: tmp as u32,
23118 })?;
23119 let tmp = buf.get_u8();
23120 __struct.param_result =
23121 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23122 enum_type: "ParamAck",
23123 value: tmp as u32,
23124 })?;
23125 Ok(__struct)
23126 }
23127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23128 let mut __tmp = BytesMut::new(bytes);
23129 #[allow(clippy::absurd_extreme_comparisons)]
23130 #[allow(unused_comparisons)]
23131 if __tmp.remaining() < Self::ENCODED_LEN {
23132 panic!(
23133 "buffer is too small (need {} bytes, but got {})",
23134 Self::ENCODED_LEN,
23135 __tmp.remaining(),
23136 )
23137 }
23138 for val in &self.param_id {
23139 __tmp.put_u8(*val);
23140 }
23141 for val in &self.param_value {
23142 __tmp.put_u8(*val);
23143 }
23144 __tmp.put_u8(self.param_type as u8);
23145 __tmp.put_u8(self.param_result as u8);
23146 if matches!(version, MavlinkVersion::V2) {
23147 let len = __tmp.len();
23148 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23149 } else {
23150 __tmp.len()
23151 }
23152 }
23153}
23154#[doc = "id: 321"]
23155#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23156#[derive(Debug, Clone, PartialEq)]
23157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23159pub struct PARAM_EXT_REQUEST_LIST_DATA {
23160 #[doc = "System ID"]
23161 pub target_system: u8,
23162 #[doc = "Component ID"]
23163 pub target_component: u8,
23164}
23165impl PARAM_EXT_REQUEST_LIST_DATA {
23166 pub const ENCODED_LEN: usize = 2usize;
23167 pub const DEFAULT: Self = Self {
23168 target_system: 0_u8,
23169 target_component: 0_u8,
23170 };
23171 #[cfg(feature = "arbitrary")]
23172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23173 use arbitrary::{Arbitrary, Unstructured};
23174 let mut buf = [0u8; 1024];
23175 rng.fill_bytes(&mut buf);
23176 let mut unstructured = Unstructured::new(&buf);
23177 Self::arbitrary(&mut unstructured).unwrap_or_default()
23178 }
23179}
23180impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23181 fn default() -> Self {
23182 Self::DEFAULT.clone()
23183 }
23184}
23185impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23186 type Message = MavMessage;
23187 const ID: u32 = 321u32;
23188 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23189 const EXTRA_CRC: u8 = 88u8;
23190 const ENCODED_LEN: usize = 2usize;
23191 fn deser(
23192 _version: MavlinkVersion,
23193 __input: &[u8],
23194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23195 let avail_len = __input.len();
23196 let mut payload_buf = [0; Self::ENCODED_LEN];
23197 let mut buf = if avail_len < Self::ENCODED_LEN {
23198 payload_buf[0..avail_len].copy_from_slice(__input);
23199 Bytes::new(&payload_buf)
23200 } else {
23201 Bytes::new(__input)
23202 };
23203 let mut __struct = Self::default();
23204 __struct.target_system = buf.get_u8();
23205 __struct.target_component = buf.get_u8();
23206 Ok(__struct)
23207 }
23208 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23209 let mut __tmp = BytesMut::new(bytes);
23210 #[allow(clippy::absurd_extreme_comparisons)]
23211 #[allow(unused_comparisons)]
23212 if __tmp.remaining() < Self::ENCODED_LEN {
23213 panic!(
23214 "buffer is too small (need {} bytes, but got {})",
23215 Self::ENCODED_LEN,
23216 __tmp.remaining(),
23217 )
23218 }
23219 __tmp.put_u8(self.target_system);
23220 __tmp.put_u8(self.target_component);
23221 if matches!(version, MavlinkVersion::V2) {
23222 let len = __tmp.len();
23223 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23224 } else {
23225 __tmp.len()
23226 }
23227 }
23228}
23229#[doc = "id: 320"]
23230#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23231#[derive(Debug, Clone, PartialEq)]
23232#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23233#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23234pub struct PARAM_EXT_REQUEST_READ_DATA {
23235 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23236 pub param_index: i16,
23237 #[doc = "System ID"]
23238 pub target_system: u8,
23239 #[doc = "Component ID"]
23240 pub target_component: u8,
23241 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23242 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23243 pub param_id: [u8; 16],
23244}
23245impl PARAM_EXT_REQUEST_READ_DATA {
23246 pub const ENCODED_LEN: usize = 20usize;
23247 pub const DEFAULT: Self = Self {
23248 param_index: 0_i16,
23249 target_system: 0_u8,
23250 target_component: 0_u8,
23251 param_id: [0_u8; 16usize],
23252 };
23253 #[cfg(feature = "arbitrary")]
23254 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23255 use arbitrary::{Arbitrary, Unstructured};
23256 let mut buf = [0u8; 1024];
23257 rng.fill_bytes(&mut buf);
23258 let mut unstructured = Unstructured::new(&buf);
23259 Self::arbitrary(&mut unstructured).unwrap_or_default()
23260 }
23261}
23262impl Default for PARAM_EXT_REQUEST_READ_DATA {
23263 fn default() -> Self {
23264 Self::DEFAULT.clone()
23265 }
23266}
23267impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23268 type Message = MavMessage;
23269 const ID: u32 = 320u32;
23270 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23271 const EXTRA_CRC: u8 = 243u8;
23272 const ENCODED_LEN: usize = 20usize;
23273 fn deser(
23274 _version: MavlinkVersion,
23275 __input: &[u8],
23276 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23277 let avail_len = __input.len();
23278 let mut payload_buf = [0; Self::ENCODED_LEN];
23279 let mut buf = if avail_len < Self::ENCODED_LEN {
23280 payload_buf[0..avail_len].copy_from_slice(__input);
23281 Bytes::new(&payload_buf)
23282 } else {
23283 Bytes::new(__input)
23284 };
23285 let mut __struct = Self::default();
23286 __struct.param_index = buf.get_i16_le();
23287 __struct.target_system = buf.get_u8();
23288 __struct.target_component = buf.get_u8();
23289 for v in &mut __struct.param_id {
23290 let val = buf.get_u8();
23291 *v = val;
23292 }
23293 Ok(__struct)
23294 }
23295 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23296 let mut __tmp = BytesMut::new(bytes);
23297 #[allow(clippy::absurd_extreme_comparisons)]
23298 #[allow(unused_comparisons)]
23299 if __tmp.remaining() < Self::ENCODED_LEN {
23300 panic!(
23301 "buffer is too small (need {} bytes, but got {})",
23302 Self::ENCODED_LEN,
23303 __tmp.remaining(),
23304 )
23305 }
23306 __tmp.put_i16_le(self.param_index);
23307 __tmp.put_u8(self.target_system);
23308 __tmp.put_u8(self.target_component);
23309 for val in &self.param_id {
23310 __tmp.put_u8(*val);
23311 }
23312 if matches!(version, MavlinkVersion::V2) {
23313 let len = __tmp.len();
23314 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23315 } else {
23316 __tmp.len()
23317 }
23318 }
23319}
23320#[doc = "id: 323"]
23321#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23322#[derive(Debug, Clone, PartialEq)]
23323#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23324#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23325pub struct PARAM_EXT_SET_DATA {
23326 #[doc = "System ID"]
23327 pub target_system: u8,
23328 #[doc = "Component ID"]
23329 pub target_component: u8,
23330 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23331 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23332 pub param_id: [u8; 16],
23333 #[doc = "Parameter value"]
23334 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23335 pub param_value: [u8; 128],
23336 #[doc = "Parameter type."]
23337 pub param_type: MavParamExtType,
23338}
23339impl PARAM_EXT_SET_DATA {
23340 pub const ENCODED_LEN: usize = 147usize;
23341 pub const DEFAULT: Self = Self {
23342 target_system: 0_u8,
23343 target_component: 0_u8,
23344 param_id: [0_u8; 16usize],
23345 param_value: [0_u8; 128usize],
23346 param_type: MavParamExtType::DEFAULT,
23347 };
23348 #[cfg(feature = "arbitrary")]
23349 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23350 use arbitrary::{Arbitrary, Unstructured};
23351 let mut buf = [0u8; 1024];
23352 rng.fill_bytes(&mut buf);
23353 let mut unstructured = Unstructured::new(&buf);
23354 Self::arbitrary(&mut unstructured).unwrap_or_default()
23355 }
23356}
23357impl Default for PARAM_EXT_SET_DATA {
23358 fn default() -> Self {
23359 Self::DEFAULT.clone()
23360 }
23361}
23362impl MessageData for PARAM_EXT_SET_DATA {
23363 type Message = MavMessage;
23364 const ID: u32 = 323u32;
23365 const NAME: &'static str = "PARAM_EXT_SET";
23366 const EXTRA_CRC: u8 = 78u8;
23367 const ENCODED_LEN: usize = 147usize;
23368 fn deser(
23369 _version: MavlinkVersion,
23370 __input: &[u8],
23371 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23372 let avail_len = __input.len();
23373 let mut payload_buf = [0; Self::ENCODED_LEN];
23374 let mut buf = if avail_len < Self::ENCODED_LEN {
23375 payload_buf[0..avail_len].copy_from_slice(__input);
23376 Bytes::new(&payload_buf)
23377 } else {
23378 Bytes::new(__input)
23379 };
23380 let mut __struct = Self::default();
23381 __struct.target_system = buf.get_u8();
23382 __struct.target_component = buf.get_u8();
23383 for v in &mut __struct.param_id {
23384 let val = buf.get_u8();
23385 *v = val;
23386 }
23387 for v in &mut __struct.param_value {
23388 let val = buf.get_u8();
23389 *v = val;
23390 }
23391 let tmp = buf.get_u8();
23392 __struct.param_type =
23393 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23394 enum_type: "MavParamExtType",
23395 value: tmp as u32,
23396 })?;
23397 Ok(__struct)
23398 }
23399 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23400 let mut __tmp = BytesMut::new(bytes);
23401 #[allow(clippy::absurd_extreme_comparisons)]
23402 #[allow(unused_comparisons)]
23403 if __tmp.remaining() < Self::ENCODED_LEN {
23404 panic!(
23405 "buffer is too small (need {} bytes, but got {})",
23406 Self::ENCODED_LEN,
23407 __tmp.remaining(),
23408 )
23409 }
23410 __tmp.put_u8(self.target_system);
23411 __tmp.put_u8(self.target_component);
23412 for val in &self.param_id {
23413 __tmp.put_u8(*val);
23414 }
23415 for val in &self.param_value {
23416 __tmp.put_u8(*val);
23417 }
23418 __tmp.put_u8(self.param_type as u8);
23419 if matches!(version, MavlinkVersion::V2) {
23420 let len = __tmp.len();
23421 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23422 } else {
23423 __tmp.len()
23424 }
23425 }
23426}
23427#[doc = "id: 322"]
23428#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23429#[derive(Debug, Clone, PartialEq)]
23430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23431#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23432pub struct PARAM_EXT_VALUE_DATA {
23433 #[doc = "Total number of parameters"]
23434 pub param_count: u16,
23435 #[doc = "Index of this parameter"]
23436 pub param_index: u16,
23437 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23438 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23439 pub param_id: [u8; 16],
23440 #[doc = "Parameter value"]
23441 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23442 pub param_value: [u8; 128],
23443 #[doc = "Parameter type."]
23444 pub param_type: MavParamExtType,
23445}
23446impl PARAM_EXT_VALUE_DATA {
23447 pub const ENCODED_LEN: usize = 149usize;
23448 pub const DEFAULT: Self = Self {
23449 param_count: 0_u16,
23450 param_index: 0_u16,
23451 param_id: [0_u8; 16usize],
23452 param_value: [0_u8; 128usize],
23453 param_type: MavParamExtType::DEFAULT,
23454 };
23455 #[cfg(feature = "arbitrary")]
23456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23457 use arbitrary::{Arbitrary, Unstructured};
23458 let mut buf = [0u8; 1024];
23459 rng.fill_bytes(&mut buf);
23460 let mut unstructured = Unstructured::new(&buf);
23461 Self::arbitrary(&mut unstructured).unwrap_or_default()
23462 }
23463}
23464impl Default for PARAM_EXT_VALUE_DATA {
23465 fn default() -> Self {
23466 Self::DEFAULT.clone()
23467 }
23468}
23469impl MessageData for PARAM_EXT_VALUE_DATA {
23470 type Message = MavMessage;
23471 const ID: u32 = 322u32;
23472 const NAME: &'static str = "PARAM_EXT_VALUE";
23473 const EXTRA_CRC: u8 = 243u8;
23474 const ENCODED_LEN: usize = 149usize;
23475 fn deser(
23476 _version: MavlinkVersion,
23477 __input: &[u8],
23478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23479 let avail_len = __input.len();
23480 let mut payload_buf = [0; Self::ENCODED_LEN];
23481 let mut buf = if avail_len < Self::ENCODED_LEN {
23482 payload_buf[0..avail_len].copy_from_slice(__input);
23483 Bytes::new(&payload_buf)
23484 } else {
23485 Bytes::new(__input)
23486 };
23487 let mut __struct = Self::default();
23488 __struct.param_count = buf.get_u16_le();
23489 __struct.param_index = buf.get_u16_le();
23490 for v in &mut __struct.param_id {
23491 let val = buf.get_u8();
23492 *v = val;
23493 }
23494 for v in &mut __struct.param_value {
23495 let val = buf.get_u8();
23496 *v = val;
23497 }
23498 let tmp = buf.get_u8();
23499 __struct.param_type =
23500 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23501 enum_type: "MavParamExtType",
23502 value: tmp as u32,
23503 })?;
23504 Ok(__struct)
23505 }
23506 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23507 let mut __tmp = BytesMut::new(bytes);
23508 #[allow(clippy::absurd_extreme_comparisons)]
23509 #[allow(unused_comparisons)]
23510 if __tmp.remaining() < Self::ENCODED_LEN {
23511 panic!(
23512 "buffer is too small (need {} bytes, but got {})",
23513 Self::ENCODED_LEN,
23514 __tmp.remaining(),
23515 )
23516 }
23517 __tmp.put_u16_le(self.param_count);
23518 __tmp.put_u16_le(self.param_index);
23519 for val in &self.param_id {
23520 __tmp.put_u8(*val);
23521 }
23522 for val in &self.param_value {
23523 __tmp.put_u8(*val);
23524 }
23525 __tmp.put_u8(self.param_type as u8);
23526 if matches!(version, MavlinkVersion::V2) {
23527 let len = __tmp.len();
23528 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23529 } else {
23530 __tmp.len()
23531 }
23532 }
23533}
23534#[doc = "id: 50"]
23535#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23536#[derive(Debug, Clone, PartialEq)]
23537#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23538#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23539pub struct PARAM_MAP_RC_DATA {
23540 #[doc = "Initial parameter value"]
23541 pub param_value0: f32,
23542 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23543 pub scale: f32,
23544 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23545 pub param_value_min: f32,
23546 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23547 pub param_value_max: f32,
23548 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23549 pub param_index: i16,
23550 #[doc = "System ID"]
23551 pub target_system: u8,
23552 #[doc = "Component ID"]
23553 pub target_component: u8,
23554 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23555 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23556 pub param_id: [u8; 16],
23557 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23558 pub parameter_rc_channel_index: u8,
23559}
23560impl PARAM_MAP_RC_DATA {
23561 pub const ENCODED_LEN: usize = 37usize;
23562 pub const DEFAULT: Self = Self {
23563 param_value0: 0.0_f32,
23564 scale: 0.0_f32,
23565 param_value_min: 0.0_f32,
23566 param_value_max: 0.0_f32,
23567 param_index: 0_i16,
23568 target_system: 0_u8,
23569 target_component: 0_u8,
23570 param_id: [0_u8; 16usize],
23571 parameter_rc_channel_index: 0_u8,
23572 };
23573 #[cfg(feature = "arbitrary")]
23574 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23575 use arbitrary::{Arbitrary, Unstructured};
23576 let mut buf = [0u8; 1024];
23577 rng.fill_bytes(&mut buf);
23578 let mut unstructured = Unstructured::new(&buf);
23579 Self::arbitrary(&mut unstructured).unwrap_or_default()
23580 }
23581}
23582impl Default for PARAM_MAP_RC_DATA {
23583 fn default() -> Self {
23584 Self::DEFAULT.clone()
23585 }
23586}
23587impl MessageData for PARAM_MAP_RC_DATA {
23588 type Message = MavMessage;
23589 const ID: u32 = 50u32;
23590 const NAME: &'static str = "PARAM_MAP_RC";
23591 const EXTRA_CRC: u8 = 78u8;
23592 const ENCODED_LEN: usize = 37usize;
23593 fn deser(
23594 _version: MavlinkVersion,
23595 __input: &[u8],
23596 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23597 let avail_len = __input.len();
23598 let mut payload_buf = [0; Self::ENCODED_LEN];
23599 let mut buf = if avail_len < Self::ENCODED_LEN {
23600 payload_buf[0..avail_len].copy_from_slice(__input);
23601 Bytes::new(&payload_buf)
23602 } else {
23603 Bytes::new(__input)
23604 };
23605 let mut __struct = Self::default();
23606 __struct.param_value0 = buf.get_f32_le();
23607 __struct.scale = buf.get_f32_le();
23608 __struct.param_value_min = buf.get_f32_le();
23609 __struct.param_value_max = buf.get_f32_le();
23610 __struct.param_index = buf.get_i16_le();
23611 __struct.target_system = buf.get_u8();
23612 __struct.target_component = buf.get_u8();
23613 for v in &mut __struct.param_id {
23614 let val = buf.get_u8();
23615 *v = val;
23616 }
23617 __struct.parameter_rc_channel_index = buf.get_u8();
23618 Ok(__struct)
23619 }
23620 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23621 let mut __tmp = BytesMut::new(bytes);
23622 #[allow(clippy::absurd_extreme_comparisons)]
23623 #[allow(unused_comparisons)]
23624 if __tmp.remaining() < Self::ENCODED_LEN {
23625 panic!(
23626 "buffer is too small (need {} bytes, but got {})",
23627 Self::ENCODED_LEN,
23628 __tmp.remaining(),
23629 )
23630 }
23631 __tmp.put_f32_le(self.param_value0);
23632 __tmp.put_f32_le(self.scale);
23633 __tmp.put_f32_le(self.param_value_min);
23634 __tmp.put_f32_le(self.param_value_max);
23635 __tmp.put_i16_le(self.param_index);
23636 __tmp.put_u8(self.target_system);
23637 __tmp.put_u8(self.target_component);
23638 for val in &self.param_id {
23639 __tmp.put_u8(*val);
23640 }
23641 __tmp.put_u8(self.parameter_rc_channel_index);
23642 if matches!(version, MavlinkVersion::V2) {
23643 let len = __tmp.len();
23644 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23645 } else {
23646 __tmp.len()
23647 }
23648 }
23649}
23650#[doc = "id: 21"]
23651#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23652#[derive(Debug, Clone, PartialEq)]
23653#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23654#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23655pub struct PARAM_REQUEST_LIST_DATA {
23656 #[doc = "System ID"]
23657 pub target_system: u8,
23658 #[doc = "Component ID"]
23659 pub target_component: u8,
23660}
23661impl PARAM_REQUEST_LIST_DATA {
23662 pub const ENCODED_LEN: usize = 2usize;
23663 pub const DEFAULT: Self = Self {
23664 target_system: 0_u8,
23665 target_component: 0_u8,
23666 };
23667 #[cfg(feature = "arbitrary")]
23668 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23669 use arbitrary::{Arbitrary, Unstructured};
23670 let mut buf = [0u8; 1024];
23671 rng.fill_bytes(&mut buf);
23672 let mut unstructured = Unstructured::new(&buf);
23673 Self::arbitrary(&mut unstructured).unwrap_or_default()
23674 }
23675}
23676impl Default for PARAM_REQUEST_LIST_DATA {
23677 fn default() -> Self {
23678 Self::DEFAULT.clone()
23679 }
23680}
23681impl MessageData for PARAM_REQUEST_LIST_DATA {
23682 type Message = MavMessage;
23683 const ID: u32 = 21u32;
23684 const NAME: &'static str = "PARAM_REQUEST_LIST";
23685 const EXTRA_CRC: u8 = 159u8;
23686 const ENCODED_LEN: usize = 2usize;
23687 fn deser(
23688 _version: MavlinkVersion,
23689 __input: &[u8],
23690 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23691 let avail_len = __input.len();
23692 let mut payload_buf = [0; Self::ENCODED_LEN];
23693 let mut buf = if avail_len < Self::ENCODED_LEN {
23694 payload_buf[0..avail_len].copy_from_slice(__input);
23695 Bytes::new(&payload_buf)
23696 } else {
23697 Bytes::new(__input)
23698 };
23699 let mut __struct = Self::default();
23700 __struct.target_system = buf.get_u8();
23701 __struct.target_component = buf.get_u8();
23702 Ok(__struct)
23703 }
23704 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23705 let mut __tmp = BytesMut::new(bytes);
23706 #[allow(clippy::absurd_extreme_comparisons)]
23707 #[allow(unused_comparisons)]
23708 if __tmp.remaining() < Self::ENCODED_LEN {
23709 panic!(
23710 "buffer is too small (need {} bytes, but got {})",
23711 Self::ENCODED_LEN,
23712 __tmp.remaining(),
23713 )
23714 }
23715 __tmp.put_u8(self.target_system);
23716 __tmp.put_u8(self.target_component);
23717 if matches!(version, MavlinkVersion::V2) {
23718 let len = __tmp.len();
23719 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23720 } else {
23721 __tmp.len()
23722 }
23723 }
23724}
23725#[doc = "id: 20"]
23726#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
23727#[derive(Debug, Clone, PartialEq)]
23728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23729#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23730pub struct PARAM_REQUEST_READ_DATA {
23731 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
23732 pub param_index: i16,
23733 #[doc = "System ID"]
23734 pub target_system: u8,
23735 #[doc = "Component ID"]
23736 pub target_component: u8,
23737 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23738 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23739 pub param_id: [u8; 16],
23740}
23741impl PARAM_REQUEST_READ_DATA {
23742 pub const ENCODED_LEN: usize = 20usize;
23743 pub const DEFAULT: Self = Self {
23744 param_index: 0_i16,
23745 target_system: 0_u8,
23746 target_component: 0_u8,
23747 param_id: [0_u8; 16usize],
23748 };
23749 #[cfg(feature = "arbitrary")]
23750 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23751 use arbitrary::{Arbitrary, Unstructured};
23752 let mut buf = [0u8; 1024];
23753 rng.fill_bytes(&mut buf);
23754 let mut unstructured = Unstructured::new(&buf);
23755 Self::arbitrary(&mut unstructured).unwrap_or_default()
23756 }
23757}
23758impl Default for PARAM_REQUEST_READ_DATA {
23759 fn default() -> Self {
23760 Self::DEFAULT.clone()
23761 }
23762}
23763impl MessageData for PARAM_REQUEST_READ_DATA {
23764 type Message = MavMessage;
23765 const ID: u32 = 20u32;
23766 const NAME: &'static str = "PARAM_REQUEST_READ";
23767 const EXTRA_CRC: u8 = 214u8;
23768 const ENCODED_LEN: usize = 20usize;
23769 fn deser(
23770 _version: MavlinkVersion,
23771 __input: &[u8],
23772 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23773 let avail_len = __input.len();
23774 let mut payload_buf = [0; Self::ENCODED_LEN];
23775 let mut buf = if avail_len < Self::ENCODED_LEN {
23776 payload_buf[0..avail_len].copy_from_slice(__input);
23777 Bytes::new(&payload_buf)
23778 } else {
23779 Bytes::new(__input)
23780 };
23781 let mut __struct = Self::default();
23782 __struct.param_index = buf.get_i16_le();
23783 __struct.target_system = buf.get_u8();
23784 __struct.target_component = buf.get_u8();
23785 for v in &mut __struct.param_id {
23786 let val = buf.get_u8();
23787 *v = val;
23788 }
23789 Ok(__struct)
23790 }
23791 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23792 let mut __tmp = BytesMut::new(bytes);
23793 #[allow(clippy::absurd_extreme_comparisons)]
23794 #[allow(unused_comparisons)]
23795 if __tmp.remaining() < Self::ENCODED_LEN {
23796 panic!(
23797 "buffer is too small (need {} bytes, but got {})",
23798 Self::ENCODED_LEN,
23799 __tmp.remaining(),
23800 )
23801 }
23802 __tmp.put_i16_le(self.param_index);
23803 __tmp.put_u8(self.target_system);
23804 __tmp.put_u8(self.target_component);
23805 for val in &self.param_id {
23806 __tmp.put_u8(*val);
23807 }
23808 if matches!(version, MavlinkVersion::V2) {
23809 let len = __tmp.len();
23810 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23811 } else {
23812 __tmp.len()
23813 }
23814 }
23815}
23816#[doc = "id: 23"]
23817#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23818#[derive(Debug, Clone, PartialEq)]
23819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23821pub struct PARAM_SET_DATA {
23822 #[doc = "Onboard parameter value"]
23823 pub param_value: f32,
23824 #[doc = "System ID"]
23825 pub target_system: u8,
23826 #[doc = "Component ID"]
23827 pub target_component: u8,
23828 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23829 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23830 pub param_id: [u8; 16],
23831 #[doc = "Onboard parameter type."]
23832 pub param_type: MavParamType,
23833}
23834impl PARAM_SET_DATA {
23835 pub const ENCODED_LEN: usize = 23usize;
23836 pub const DEFAULT: Self = Self {
23837 param_value: 0.0_f32,
23838 target_system: 0_u8,
23839 target_component: 0_u8,
23840 param_id: [0_u8; 16usize],
23841 param_type: MavParamType::DEFAULT,
23842 };
23843 #[cfg(feature = "arbitrary")]
23844 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23845 use arbitrary::{Arbitrary, Unstructured};
23846 let mut buf = [0u8; 1024];
23847 rng.fill_bytes(&mut buf);
23848 let mut unstructured = Unstructured::new(&buf);
23849 Self::arbitrary(&mut unstructured).unwrap_or_default()
23850 }
23851}
23852impl Default for PARAM_SET_DATA {
23853 fn default() -> Self {
23854 Self::DEFAULT.clone()
23855 }
23856}
23857impl MessageData for PARAM_SET_DATA {
23858 type Message = MavMessage;
23859 const ID: u32 = 23u32;
23860 const NAME: &'static str = "PARAM_SET";
23861 const EXTRA_CRC: u8 = 168u8;
23862 const ENCODED_LEN: usize = 23usize;
23863 fn deser(
23864 _version: MavlinkVersion,
23865 __input: &[u8],
23866 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23867 let avail_len = __input.len();
23868 let mut payload_buf = [0; Self::ENCODED_LEN];
23869 let mut buf = if avail_len < Self::ENCODED_LEN {
23870 payload_buf[0..avail_len].copy_from_slice(__input);
23871 Bytes::new(&payload_buf)
23872 } else {
23873 Bytes::new(__input)
23874 };
23875 let mut __struct = Self::default();
23876 __struct.param_value = buf.get_f32_le();
23877 __struct.target_system = buf.get_u8();
23878 __struct.target_component = buf.get_u8();
23879 for v in &mut __struct.param_id {
23880 let val = buf.get_u8();
23881 *v = val;
23882 }
23883 let tmp = buf.get_u8();
23884 __struct.param_type =
23885 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23886 enum_type: "MavParamType",
23887 value: tmp as u32,
23888 })?;
23889 Ok(__struct)
23890 }
23891 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23892 let mut __tmp = BytesMut::new(bytes);
23893 #[allow(clippy::absurd_extreme_comparisons)]
23894 #[allow(unused_comparisons)]
23895 if __tmp.remaining() < Self::ENCODED_LEN {
23896 panic!(
23897 "buffer is too small (need {} bytes, but got {})",
23898 Self::ENCODED_LEN,
23899 __tmp.remaining(),
23900 )
23901 }
23902 __tmp.put_f32_le(self.param_value);
23903 __tmp.put_u8(self.target_system);
23904 __tmp.put_u8(self.target_component);
23905 for val in &self.param_id {
23906 __tmp.put_u8(*val);
23907 }
23908 __tmp.put_u8(self.param_type as u8);
23909 if matches!(version, MavlinkVersion::V2) {
23910 let len = __tmp.len();
23911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23912 } else {
23913 __tmp.len()
23914 }
23915 }
23916}
23917#[doc = "id: 22"]
23918#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23919#[derive(Debug, Clone, PartialEq)]
23920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23922pub struct PARAM_VALUE_DATA {
23923 #[doc = "Onboard parameter value"]
23924 pub param_value: f32,
23925 #[doc = "Total number of onboard parameters"]
23926 pub param_count: u16,
23927 #[doc = "Index of this onboard parameter"]
23928 pub param_index: u16,
23929 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23930 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23931 pub param_id: [u8; 16],
23932 #[doc = "Onboard parameter type."]
23933 pub param_type: MavParamType,
23934}
23935impl PARAM_VALUE_DATA {
23936 pub const ENCODED_LEN: usize = 25usize;
23937 pub const DEFAULT: Self = Self {
23938 param_value: 0.0_f32,
23939 param_count: 0_u16,
23940 param_index: 0_u16,
23941 param_id: [0_u8; 16usize],
23942 param_type: MavParamType::DEFAULT,
23943 };
23944 #[cfg(feature = "arbitrary")]
23945 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23946 use arbitrary::{Arbitrary, Unstructured};
23947 let mut buf = [0u8; 1024];
23948 rng.fill_bytes(&mut buf);
23949 let mut unstructured = Unstructured::new(&buf);
23950 Self::arbitrary(&mut unstructured).unwrap_or_default()
23951 }
23952}
23953impl Default for PARAM_VALUE_DATA {
23954 fn default() -> Self {
23955 Self::DEFAULT.clone()
23956 }
23957}
23958impl MessageData for PARAM_VALUE_DATA {
23959 type Message = MavMessage;
23960 const ID: u32 = 22u32;
23961 const NAME: &'static str = "PARAM_VALUE";
23962 const EXTRA_CRC: u8 = 220u8;
23963 const ENCODED_LEN: usize = 25usize;
23964 fn deser(
23965 _version: MavlinkVersion,
23966 __input: &[u8],
23967 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23968 let avail_len = __input.len();
23969 let mut payload_buf = [0; Self::ENCODED_LEN];
23970 let mut buf = if avail_len < Self::ENCODED_LEN {
23971 payload_buf[0..avail_len].copy_from_slice(__input);
23972 Bytes::new(&payload_buf)
23973 } else {
23974 Bytes::new(__input)
23975 };
23976 let mut __struct = Self::default();
23977 __struct.param_value = buf.get_f32_le();
23978 __struct.param_count = buf.get_u16_le();
23979 __struct.param_index = buf.get_u16_le();
23980 for v in &mut __struct.param_id {
23981 let val = buf.get_u8();
23982 *v = val;
23983 }
23984 let tmp = buf.get_u8();
23985 __struct.param_type =
23986 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23987 enum_type: "MavParamType",
23988 value: tmp as u32,
23989 })?;
23990 Ok(__struct)
23991 }
23992 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23993 let mut __tmp = BytesMut::new(bytes);
23994 #[allow(clippy::absurd_extreme_comparisons)]
23995 #[allow(unused_comparisons)]
23996 if __tmp.remaining() < Self::ENCODED_LEN {
23997 panic!(
23998 "buffer is too small (need {} bytes, but got {})",
23999 Self::ENCODED_LEN,
24000 __tmp.remaining(),
24001 )
24002 }
24003 __tmp.put_f32_le(self.param_value);
24004 __tmp.put_u16_le(self.param_count);
24005 __tmp.put_u16_le(self.param_index);
24006 for val in &self.param_id {
24007 __tmp.put_u8(*val);
24008 }
24009 __tmp.put_u8(self.param_type as u8);
24010 if matches!(version, MavlinkVersion::V2) {
24011 let len = __tmp.len();
24012 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24013 } else {
24014 __tmp.len()
24015 }
24016 }
24017}
24018#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24019#[doc = "id: 4"]
24020#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24021#[derive(Debug, Clone, PartialEq)]
24022#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24023#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24024pub struct PING_DATA {
24025 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24026 pub time_usec: u64,
24027 #[doc = "PING sequence"]
24028 pub seq: u32,
24029 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24030 pub target_system: u8,
24031 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24032 pub target_component: u8,
24033}
24034impl PING_DATA {
24035 pub const ENCODED_LEN: usize = 14usize;
24036 pub const DEFAULT: Self = Self {
24037 time_usec: 0_u64,
24038 seq: 0_u32,
24039 target_system: 0_u8,
24040 target_component: 0_u8,
24041 };
24042 #[cfg(feature = "arbitrary")]
24043 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24044 use arbitrary::{Arbitrary, Unstructured};
24045 let mut buf = [0u8; 1024];
24046 rng.fill_bytes(&mut buf);
24047 let mut unstructured = Unstructured::new(&buf);
24048 Self::arbitrary(&mut unstructured).unwrap_or_default()
24049 }
24050}
24051impl Default for PING_DATA {
24052 fn default() -> Self {
24053 Self::DEFAULT.clone()
24054 }
24055}
24056impl MessageData for PING_DATA {
24057 type Message = MavMessage;
24058 const ID: u32 = 4u32;
24059 const NAME: &'static str = "PING";
24060 const EXTRA_CRC: u8 = 237u8;
24061 const ENCODED_LEN: usize = 14usize;
24062 fn deser(
24063 _version: MavlinkVersion,
24064 __input: &[u8],
24065 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24066 let avail_len = __input.len();
24067 let mut payload_buf = [0; Self::ENCODED_LEN];
24068 let mut buf = if avail_len < Self::ENCODED_LEN {
24069 payload_buf[0..avail_len].copy_from_slice(__input);
24070 Bytes::new(&payload_buf)
24071 } else {
24072 Bytes::new(__input)
24073 };
24074 let mut __struct = Self::default();
24075 __struct.time_usec = buf.get_u64_le();
24076 __struct.seq = buf.get_u32_le();
24077 __struct.target_system = buf.get_u8();
24078 __struct.target_component = buf.get_u8();
24079 Ok(__struct)
24080 }
24081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24082 let mut __tmp = BytesMut::new(bytes);
24083 #[allow(clippy::absurd_extreme_comparisons)]
24084 #[allow(unused_comparisons)]
24085 if __tmp.remaining() < Self::ENCODED_LEN {
24086 panic!(
24087 "buffer is too small (need {} bytes, but got {})",
24088 Self::ENCODED_LEN,
24089 __tmp.remaining(),
24090 )
24091 }
24092 __tmp.put_u64_le(self.time_usec);
24093 __tmp.put_u32_le(self.seq);
24094 __tmp.put_u8(self.target_system);
24095 __tmp.put_u8(self.target_component);
24096 if matches!(version, MavlinkVersion::V2) {
24097 let len = __tmp.len();
24098 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24099 } else {
24100 __tmp.len()
24101 }
24102 }
24103}
24104#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24105#[doc = "id: 258"]
24106#[doc = "Control vehicle tone generation (buzzer)."]
24107#[derive(Debug, Clone, PartialEq)]
24108#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24109#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24110pub struct PLAY_TUNE_DATA {
24111 #[doc = "System ID"]
24112 pub target_system: u8,
24113 #[doc = "Component ID"]
24114 pub target_component: u8,
24115 #[doc = "tune in board specific format"]
24116 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24117 pub tune: [u8; 30],
24118 #[doc = "tune extension (appended to tune)"]
24119 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24120 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24121 pub tune2: [u8; 200],
24122}
24123impl PLAY_TUNE_DATA {
24124 pub const ENCODED_LEN: usize = 232usize;
24125 pub const DEFAULT: Self = Self {
24126 target_system: 0_u8,
24127 target_component: 0_u8,
24128 tune: [0_u8; 30usize],
24129 tune2: [0_u8; 200usize],
24130 };
24131 #[cfg(feature = "arbitrary")]
24132 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24133 use arbitrary::{Arbitrary, Unstructured};
24134 let mut buf = [0u8; 1024];
24135 rng.fill_bytes(&mut buf);
24136 let mut unstructured = Unstructured::new(&buf);
24137 Self::arbitrary(&mut unstructured).unwrap_or_default()
24138 }
24139}
24140impl Default for PLAY_TUNE_DATA {
24141 fn default() -> Self {
24142 Self::DEFAULT.clone()
24143 }
24144}
24145impl MessageData for PLAY_TUNE_DATA {
24146 type Message = MavMessage;
24147 const ID: u32 = 258u32;
24148 const NAME: &'static str = "PLAY_TUNE";
24149 const EXTRA_CRC: u8 = 187u8;
24150 const ENCODED_LEN: usize = 232usize;
24151 fn deser(
24152 _version: MavlinkVersion,
24153 __input: &[u8],
24154 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24155 let avail_len = __input.len();
24156 let mut payload_buf = [0; Self::ENCODED_LEN];
24157 let mut buf = if avail_len < Self::ENCODED_LEN {
24158 payload_buf[0..avail_len].copy_from_slice(__input);
24159 Bytes::new(&payload_buf)
24160 } else {
24161 Bytes::new(__input)
24162 };
24163 let mut __struct = Self::default();
24164 __struct.target_system = buf.get_u8();
24165 __struct.target_component = buf.get_u8();
24166 for v in &mut __struct.tune {
24167 let val = buf.get_u8();
24168 *v = val;
24169 }
24170 for v in &mut __struct.tune2 {
24171 let val = buf.get_u8();
24172 *v = val;
24173 }
24174 Ok(__struct)
24175 }
24176 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24177 let mut __tmp = BytesMut::new(bytes);
24178 #[allow(clippy::absurd_extreme_comparisons)]
24179 #[allow(unused_comparisons)]
24180 if __tmp.remaining() < Self::ENCODED_LEN {
24181 panic!(
24182 "buffer is too small (need {} bytes, but got {})",
24183 Self::ENCODED_LEN,
24184 __tmp.remaining(),
24185 )
24186 }
24187 __tmp.put_u8(self.target_system);
24188 __tmp.put_u8(self.target_component);
24189 for val in &self.tune {
24190 __tmp.put_u8(*val);
24191 }
24192 for val in &self.tune2 {
24193 __tmp.put_u8(*val);
24194 }
24195 if matches!(version, MavlinkVersion::V2) {
24196 let len = __tmp.len();
24197 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24198 } else {
24199 __tmp.len()
24200 }
24201 }
24202}
24203#[doc = "id: 400"]
24204#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24205#[derive(Debug, Clone, PartialEq)]
24206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24207#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24208pub struct PLAY_TUNE_V2_DATA {
24209 #[doc = "Tune format"]
24210 pub format: TuneFormat,
24211 #[doc = "System ID"]
24212 pub target_system: u8,
24213 #[doc = "Component ID"]
24214 pub target_component: u8,
24215 #[doc = "Tune definition as a NULL-terminated string."]
24216 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24217 pub tune: [u8; 248],
24218}
24219impl PLAY_TUNE_V2_DATA {
24220 pub const ENCODED_LEN: usize = 254usize;
24221 pub const DEFAULT: Self = Self {
24222 format: TuneFormat::DEFAULT,
24223 target_system: 0_u8,
24224 target_component: 0_u8,
24225 tune: [0_u8; 248usize],
24226 };
24227 #[cfg(feature = "arbitrary")]
24228 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24229 use arbitrary::{Arbitrary, Unstructured};
24230 let mut buf = [0u8; 1024];
24231 rng.fill_bytes(&mut buf);
24232 let mut unstructured = Unstructured::new(&buf);
24233 Self::arbitrary(&mut unstructured).unwrap_or_default()
24234 }
24235}
24236impl Default for PLAY_TUNE_V2_DATA {
24237 fn default() -> Self {
24238 Self::DEFAULT.clone()
24239 }
24240}
24241impl MessageData for PLAY_TUNE_V2_DATA {
24242 type Message = MavMessage;
24243 const ID: u32 = 400u32;
24244 const NAME: &'static str = "PLAY_TUNE_V2";
24245 const EXTRA_CRC: u8 = 110u8;
24246 const ENCODED_LEN: usize = 254usize;
24247 fn deser(
24248 _version: MavlinkVersion,
24249 __input: &[u8],
24250 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24251 let avail_len = __input.len();
24252 let mut payload_buf = [0; Self::ENCODED_LEN];
24253 let mut buf = if avail_len < Self::ENCODED_LEN {
24254 payload_buf[0..avail_len].copy_from_slice(__input);
24255 Bytes::new(&payload_buf)
24256 } else {
24257 Bytes::new(__input)
24258 };
24259 let mut __struct = Self::default();
24260 let tmp = buf.get_u32_le();
24261 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24262 ::mavlink_core::error::ParserError::InvalidEnum {
24263 enum_type: "TuneFormat",
24264 value: tmp as u32,
24265 },
24266 )?;
24267 __struct.target_system = buf.get_u8();
24268 __struct.target_component = buf.get_u8();
24269 for v in &mut __struct.tune {
24270 let val = buf.get_u8();
24271 *v = val;
24272 }
24273 Ok(__struct)
24274 }
24275 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24276 let mut __tmp = BytesMut::new(bytes);
24277 #[allow(clippy::absurd_extreme_comparisons)]
24278 #[allow(unused_comparisons)]
24279 if __tmp.remaining() < Self::ENCODED_LEN {
24280 panic!(
24281 "buffer is too small (need {} bytes, but got {})",
24282 Self::ENCODED_LEN,
24283 __tmp.remaining(),
24284 )
24285 }
24286 __tmp.put_u32_le(self.format as u32);
24287 __tmp.put_u8(self.target_system);
24288 __tmp.put_u8(self.target_component);
24289 for val in &self.tune {
24290 __tmp.put_u8(*val);
24291 }
24292 if matches!(version, MavlinkVersion::V2) {
24293 let len = __tmp.len();
24294 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24295 } else {
24296 __tmp.len()
24297 }
24298 }
24299}
24300#[doc = "id: 87"]
24301#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24302#[derive(Debug, Clone, PartialEq)]
24303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24305pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24306 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24307 pub time_boot_ms: u32,
24308 #[doc = "Latitude in WGS84 frame"]
24309 pub lat_int: i32,
24310 #[doc = "Longitude in WGS84 frame"]
24311 pub lon_int: i32,
24312 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24313 pub alt: f32,
24314 #[doc = "X velocity in NED frame"]
24315 pub vx: f32,
24316 #[doc = "Y velocity in NED frame"]
24317 pub vy: f32,
24318 #[doc = "Z velocity in NED frame"]
24319 pub vz: f32,
24320 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24321 pub afx: f32,
24322 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24323 pub afy: f32,
24324 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24325 pub afz: f32,
24326 #[doc = "yaw setpoint"]
24327 pub yaw: f32,
24328 #[doc = "yaw rate setpoint"]
24329 pub yaw_rate: f32,
24330 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24331 pub type_mask: PositionTargetTypemask,
24332 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24333 pub coordinate_frame: MavFrame,
24334}
24335impl POSITION_TARGET_GLOBAL_INT_DATA {
24336 pub const ENCODED_LEN: usize = 51usize;
24337 pub const DEFAULT: Self = Self {
24338 time_boot_ms: 0_u32,
24339 lat_int: 0_i32,
24340 lon_int: 0_i32,
24341 alt: 0.0_f32,
24342 vx: 0.0_f32,
24343 vy: 0.0_f32,
24344 vz: 0.0_f32,
24345 afx: 0.0_f32,
24346 afy: 0.0_f32,
24347 afz: 0.0_f32,
24348 yaw: 0.0_f32,
24349 yaw_rate: 0.0_f32,
24350 type_mask: PositionTargetTypemask::DEFAULT,
24351 coordinate_frame: MavFrame::DEFAULT,
24352 };
24353 #[cfg(feature = "arbitrary")]
24354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24355 use arbitrary::{Arbitrary, Unstructured};
24356 let mut buf = [0u8; 1024];
24357 rng.fill_bytes(&mut buf);
24358 let mut unstructured = Unstructured::new(&buf);
24359 Self::arbitrary(&mut unstructured).unwrap_or_default()
24360 }
24361}
24362impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24363 fn default() -> Self {
24364 Self::DEFAULT.clone()
24365 }
24366}
24367impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24368 type Message = MavMessage;
24369 const ID: u32 = 87u32;
24370 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24371 const EXTRA_CRC: u8 = 150u8;
24372 const ENCODED_LEN: usize = 51usize;
24373 fn deser(
24374 _version: MavlinkVersion,
24375 __input: &[u8],
24376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24377 let avail_len = __input.len();
24378 let mut payload_buf = [0; Self::ENCODED_LEN];
24379 let mut buf = if avail_len < Self::ENCODED_LEN {
24380 payload_buf[0..avail_len].copy_from_slice(__input);
24381 Bytes::new(&payload_buf)
24382 } else {
24383 Bytes::new(__input)
24384 };
24385 let mut __struct = Self::default();
24386 __struct.time_boot_ms = buf.get_u32_le();
24387 __struct.lat_int = buf.get_i32_le();
24388 __struct.lon_int = buf.get_i32_le();
24389 __struct.alt = buf.get_f32_le();
24390 __struct.vx = buf.get_f32_le();
24391 __struct.vy = buf.get_f32_le();
24392 __struct.vz = buf.get_f32_le();
24393 __struct.afx = buf.get_f32_le();
24394 __struct.afy = buf.get_f32_le();
24395 __struct.afz = buf.get_f32_le();
24396 __struct.yaw = buf.get_f32_le();
24397 __struct.yaw_rate = buf.get_f32_le();
24398 let tmp = buf.get_u16_le();
24399 __struct.type_mask = PositionTargetTypemask::from_bits(
24400 tmp & PositionTargetTypemask::all().bits(),
24401 )
24402 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24403 flag_type: "PositionTargetTypemask",
24404 value: tmp as u32,
24405 })?;
24406 let tmp = buf.get_u8();
24407 __struct.coordinate_frame =
24408 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24409 enum_type: "MavFrame",
24410 value: tmp as u32,
24411 })?;
24412 Ok(__struct)
24413 }
24414 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24415 let mut __tmp = BytesMut::new(bytes);
24416 #[allow(clippy::absurd_extreme_comparisons)]
24417 #[allow(unused_comparisons)]
24418 if __tmp.remaining() < Self::ENCODED_LEN {
24419 panic!(
24420 "buffer is too small (need {} bytes, but got {})",
24421 Self::ENCODED_LEN,
24422 __tmp.remaining(),
24423 )
24424 }
24425 __tmp.put_u32_le(self.time_boot_ms);
24426 __tmp.put_i32_le(self.lat_int);
24427 __tmp.put_i32_le(self.lon_int);
24428 __tmp.put_f32_le(self.alt);
24429 __tmp.put_f32_le(self.vx);
24430 __tmp.put_f32_le(self.vy);
24431 __tmp.put_f32_le(self.vz);
24432 __tmp.put_f32_le(self.afx);
24433 __tmp.put_f32_le(self.afy);
24434 __tmp.put_f32_le(self.afz);
24435 __tmp.put_f32_le(self.yaw);
24436 __tmp.put_f32_le(self.yaw_rate);
24437 __tmp.put_u16_le(self.type_mask.bits());
24438 __tmp.put_u8(self.coordinate_frame as u8);
24439 if matches!(version, MavlinkVersion::V2) {
24440 let len = __tmp.len();
24441 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24442 } else {
24443 __tmp.len()
24444 }
24445 }
24446}
24447#[doc = "id: 85"]
24448#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24449#[derive(Debug, Clone, PartialEq)]
24450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24452pub struct POSITION_TARGET_LOCAL_NED_DATA {
24453 #[doc = "Timestamp (time since system boot)."]
24454 pub time_boot_ms: u32,
24455 #[doc = "X Position in NED frame"]
24456 pub x: f32,
24457 #[doc = "Y Position in NED frame"]
24458 pub y: f32,
24459 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24460 pub z: f32,
24461 #[doc = "X velocity in NED frame"]
24462 pub vx: f32,
24463 #[doc = "Y velocity in NED frame"]
24464 pub vy: f32,
24465 #[doc = "Z velocity in NED frame"]
24466 pub vz: f32,
24467 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24468 pub afx: f32,
24469 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24470 pub afy: f32,
24471 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24472 pub afz: f32,
24473 #[doc = "yaw setpoint"]
24474 pub yaw: f32,
24475 #[doc = "yaw rate setpoint"]
24476 pub yaw_rate: f32,
24477 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24478 pub type_mask: PositionTargetTypemask,
24479 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24480 pub coordinate_frame: MavFrame,
24481}
24482impl POSITION_TARGET_LOCAL_NED_DATA {
24483 pub const ENCODED_LEN: usize = 51usize;
24484 pub const DEFAULT: Self = Self {
24485 time_boot_ms: 0_u32,
24486 x: 0.0_f32,
24487 y: 0.0_f32,
24488 z: 0.0_f32,
24489 vx: 0.0_f32,
24490 vy: 0.0_f32,
24491 vz: 0.0_f32,
24492 afx: 0.0_f32,
24493 afy: 0.0_f32,
24494 afz: 0.0_f32,
24495 yaw: 0.0_f32,
24496 yaw_rate: 0.0_f32,
24497 type_mask: PositionTargetTypemask::DEFAULT,
24498 coordinate_frame: MavFrame::DEFAULT,
24499 };
24500 #[cfg(feature = "arbitrary")]
24501 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24502 use arbitrary::{Arbitrary, Unstructured};
24503 let mut buf = [0u8; 1024];
24504 rng.fill_bytes(&mut buf);
24505 let mut unstructured = Unstructured::new(&buf);
24506 Self::arbitrary(&mut unstructured).unwrap_or_default()
24507 }
24508}
24509impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24510 fn default() -> Self {
24511 Self::DEFAULT.clone()
24512 }
24513}
24514impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24515 type Message = MavMessage;
24516 const ID: u32 = 85u32;
24517 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24518 const EXTRA_CRC: u8 = 140u8;
24519 const ENCODED_LEN: usize = 51usize;
24520 fn deser(
24521 _version: MavlinkVersion,
24522 __input: &[u8],
24523 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24524 let avail_len = __input.len();
24525 let mut payload_buf = [0; Self::ENCODED_LEN];
24526 let mut buf = if avail_len < Self::ENCODED_LEN {
24527 payload_buf[0..avail_len].copy_from_slice(__input);
24528 Bytes::new(&payload_buf)
24529 } else {
24530 Bytes::new(__input)
24531 };
24532 let mut __struct = Self::default();
24533 __struct.time_boot_ms = buf.get_u32_le();
24534 __struct.x = buf.get_f32_le();
24535 __struct.y = buf.get_f32_le();
24536 __struct.z = buf.get_f32_le();
24537 __struct.vx = buf.get_f32_le();
24538 __struct.vy = buf.get_f32_le();
24539 __struct.vz = buf.get_f32_le();
24540 __struct.afx = buf.get_f32_le();
24541 __struct.afy = buf.get_f32_le();
24542 __struct.afz = buf.get_f32_le();
24543 __struct.yaw = buf.get_f32_le();
24544 __struct.yaw_rate = buf.get_f32_le();
24545 let tmp = buf.get_u16_le();
24546 __struct.type_mask = PositionTargetTypemask::from_bits(
24547 tmp & PositionTargetTypemask::all().bits(),
24548 )
24549 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24550 flag_type: "PositionTargetTypemask",
24551 value: tmp as u32,
24552 })?;
24553 let tmp = buf.get_u8();
24554 __struct.coordinate_frame =
24555 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24556 enum_type: "MavFrame",
24557 value: tmp as u32,
24558 })?;
24559 Ok(__struct)
24560 }
24561 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24562 let mut __tmp = BytesMut::new(bytes);
24563 #[allow(clippy::absurd_extreme_comparisons)]
24564 #[allow(unused_comparisons)]
24565 if __tmp.remaining() < Self::ENCODED_LEN {
24566 panic!(
24567 "buffer is too small (need {} bytes, but got {})",
24568 Self::ENCODED_LEN,
24569 __tmp.remaining(),
24570 )
24571 }
24572 __tmp.put_u32_le(self.time_boot_ms);
24573 __tmp.put_f32_le(self.x);
24574 __tmp.put_f32_le(self.y);
24575 __tmp.put_f32_le(self.z);
24576 __tmp.put_f32_le(self.vx);
24577 __tmp.put_f32_le(self.vy);
24578 __tmp.put_f32_le(self.vz);
24579 __tmp.put_f32_le(self.afx);
24580 __tmp.put_f32_le(self.afy);
24581 __tmp.put_f32_le(self.afz);
24582 __tmp.put_f32_le(self.yaw);
24583 __tmp.put_f32_le(self.yaw_rate);
24584 __tmp.put_u16_le(self.type_mask.bits());
24585 __tmp.put_u8(self.coordinate_frame as u8);
24586 if matches!(version, MavlinkVersion::V2) {
24587 let len = __tmp.len();
24588 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24589 } else {
24590 __tmp.len()
24591 }
24592 }
24593}
24594#[doc = "id: 125"]
24595#[doc = "Power supply status."]
24596#[derive(Debug, Clone, PartialEq)]
24597#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24599pub struct POWER_STATUS_DATA {
24600 #[doc = "5V rail voltage."]
24601 pub Vcc: u16,
24602 #[doc = "Servo rail voltage."]
24603 pub Vservo: u16,
24604 #[doc = "Bitmap of power supply status flags."]
24605 pub flags: MavPowerStatus,
24606}
24607impl POWER_STATUS_DATA {
24608 pub const ENCODED_LEN: usize = 6usize;
24609 pub const DEFAULT: Self = Self {
24610 Vcc: 0_u16,
24611 Vservo: 0_u16,
24612 flags: MavPowerStatus::DEFAULT,
24613 };
24614 #[cfg(feature = "arbitrary")]
24615 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24616 use arbitrary::{Arbitrary, Unstructured};
24617 let mut buf = [0u8; 1024];
24618 rng.fill_bytes(&mut buf);
24619 let mut unstructured = Unstructured::new(&buf);
24620 Self::arbitrary(&mut unstructured).unwrap_or_default()
24621 }
24622}
24623impl Default for POWER_STATUS_DATA {
24624 fn default() -> Self {
24625 Self::DEFAULT.clone()
24626 }
24627}
24628impl MessageData for POWER_STATUS_DATA {
24629 type Message = MavMessage;
24630 const ID: u32 = 125u32;
24631 const NAME: &'static str = "POWER_STATUS";
24632 const EXTRA_CRC: u8 = 203u8;
24633 const ENCODED_LEN: usize = 6usize;
24634 fn deser(
24635 _version: MavlinkVersion,
24636 __input: &[u8],
24637 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24638 let avail_len = __input.len();
24639 let mut payload_buf = [0; Self::ENCODED_LEN];
24640 let mut buf = if avail_len < Self::ENCODED_LEN {
24641 payload_buf[0..avail_len].copy_from_slice(__input);
24642 Bytes::new(&payload_buf)
24643 } else {
24644 Bytes::new(__input)
24645 };
24646 let mut __struct = Self::default();
24647 __struct.Vcc = buf.get_u16_le();
24648 __struct.Vservo = buf.get_u16_le();
24649 let tmp = buf.get_u16_le();
24650 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
24651 ::mavlink_core::error::ParserError::InvalidFlag {
24652 flag_type: "MavPowerStatus",
24653 value: tmp as u32,
24654 },
24655 )?;
24656 Ok(__struct)
24657 }
24658 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24659 let mut __tmp = BytesMut::new(bytes);
24660 #[allow(clippy::absurd_extreme_comparisons)]
24661 #[allow(unused_comparisons)]
24662 if __tmp.remaining() < Self::ENCODED_LEN {
24663 panic!(
24664 "buffer is too small (need {} bytes, but got {})",
24665 Self::ENCODED_LEN,
24666 __tmp.remaining(),
24667 )
24668 }
24669 __tmp.put_u16_le(self.Vcc);
24670 __tmp.put_u16_le(self.Vservo);
24671 __tmp.put_u16_le(self.flags.bits());
24672 if matches!(version, MavlinkVersion::V2) {
24673 let len = __tmp.len();
24674 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24675 } else {
24676 __tmp.len()
24677 }
24678 }
24679}
24680#[doc = "id: 300"]
24681#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
24682#[derive(Debug, Clone, PartialEq)]
24683#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24684#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24685pub struct PROTOCOL_VERSION_DATA {
24686 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
24687 pub version: u16,
24688 #[doc = "Minimum MAVLink version supported"]
24689 pub min_version: u16,
24690 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
24691 pub max_version: u16,
24692 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24693 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24694 pub spec_version_hash: [u8; 8],
24695 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24696 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24697 pub library_version_hash: [u8; 8],
24698}
24699impl PROTOCOL_VERSION_DATA {
24700 pub const ENCODED_LEN: usize = 22usize;
24701 pub const DEFAULT: Self = Self {
24702 version: 0_u16,
24703 min_version: 0_u16,
24704 max_version: 0_u16,
24705 spec_version_hash: [0_u8; 8usize],
24706 library_version_hash: [0_u8; 8usize],
24707 };
24708 #[cfg(feature = "arbitrary")]
24709 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24710 use arbitrary::{Arbitrary, Unstructured};
24711 let mut buf = [0u8; 1024];
24712 rng.fill_bytes(&mut buf);
24713 let mut unstructured = Unstructured::new(&buf);
24714 Self::arbitrary(&mut unstructured).unwrap_or_default()
24715 }
24716}
24717impl Default for PROTOCOL_VERSION_DATA {
24718 fn default() -> Self {
24719 Self::DEFAULT.clone()
24720 }
24721}
24722impl MessageData for PROTOCOL_VERSION_DATA {
24723 type Message = MavMessage;
24724 const ID: u32 = 300u32;
24725 const NAME: &'static str = "PROTOCOL_VERSION";
24726 const EXTRA_CRC: u8 = 217u8;
24727 const ENCODED_LEN: usize = 22usize;
24728 fn deser(
24729 _version: MavlinkVersion,
24730 __input: &[u8],
24731 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24732 let avail_len = __input.len();
24733 let mut payload_buf = [0; Self::ENCODED_LEN];
24734 let mut buf = if avail_len < Self::ENCODED_LEN {
24735 payload_buf[0..avail_len].copy_from_slice(__input);
24736 Bytes::new(&payload_buf)
24737 } else {
24738 Bytes::new(__input)
24739 };
24740 let mut __struct = Self::default();
24741 __struct.version = buf.get_u16_le();
24742 __struct.min_version = buf.get_u16_le();
24743 __struct.max_version = buf.get_u16_le();
24744 for v in &mut __struct.spec_version_hash {
24745 let val = buf.get_u8();
24746 *v = val;
24747 }
24748 for v in &mut __struct.library_version_hash {
24749 let val = buf.get_u8();
24750 *v = val;
24751 }
24752 Ok(__struct)
24753 }
24754 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24755 let mut __tmp = BytesMut::new(bytes);
24756 #[allow(clippy::absurd_extreme_comparisons)]
24757 #[allow(unused_comparisons)]
24758 if __tmp.remaining() < Self::ENCODED_LEN {
24759 panic!(
24760 "buffer is too small (need {} bytes, but got {})",
24761 Self::ENCODED_LEN,
24762 __tmp.remaining(),
24763 )
24764 }
24765 __tmp.put_u16_le(self.version);
24766 __tmp.put_u16_le(self.min_version);
24767 __tmp.put_u16_le(self.max_version);
24768 for val in &self.spec_version_hash {
24769 __tmp.put_u8(*val);
24770 }
24771 for val in &self.library_version_hash {
24772 __tmp.put_u8(*val);
24773 }
24774 if matches!(version, MavlinkVersion::V2) {
24775 let len = __tmp.len();
24776 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24777 } else {
24778 __tmp.len()
24779 }
24780 }
24781}
24782#[doc = "id: 420"]
24783#[doc = "RC channel outputs from a MAVLink RC receiver for input to a flight controller or other components (allows an RC receiver to connect via MAVLink instead of some other protocol such as PPM-Sum or S.BUS). Note that this is not intended to be an over-the-air format, and does not replace RC_CHANNELS and similar messages reported by the flight controller. The target_system field should normally be set to the system id of the system to control, typically the flight controller. The target_component field can normally be set to 0, so that all components of the system can receive the message. The channels array field can publish up to 32 channels; the number of channel items used in the array is specified in the count field. The time_last_update_ms field contains the timestamp of the last received valid channels data in the receiver's time domain. The count field indicates the first index of the channel array that is not used for channel data (this and later indexes are zero-filled). The RADIO_RC_CHANNELS_FLAGS_OUTDATED flag is set by the receiver if the channels data is not up-to-date (for example, if new data from the transmitter could not be validated so the last valid data is resent). The RADIO_RC_CHANNELS_FLAGS_FAILSAFE failsafe flag is set by the receiver if the receiver's failsafe condition is met (implementation dependent, e.g., connection to the RC radio is lost). In this case time_last_update_ms still contains the timestamp of the last valid channels data, but the content of the channels data is not defined by the protocol (it is up to the implementation of the receiver). For instance, the channels data could contain failsafe values configured in the receiver; the default is to carry the last valid data. Note: The RC channels fields are extensions to ensure that they are located at the end of the serialized payload and subject to MAVLink's trailing-zero trimming."]
24784#[derive(Debug, Clone, PartialEq)]
24785#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24787pub struct RADIO_RC_CHANNELS_DATA {
24788 #[doc = "Time when the data in the channels field were last updated (time since boot in the receiver's time domain)."]
24789 pub time_last_update_ms: u32,
24790 #[doc = "Radio RC channels status flags."]
24791 pub flags: RadioRcChannelsFlags,
24792 #[doc = "System ID (ID of target system, normally flight controller)."]
24793 pub target_system: u8,
24794 #[doc = "Component ID (normally 0 for broadcast)."]
24795 pub target_component: u8,
24796 #[doc = "Total number of RC channels being received. This can be larger than 32, indicating that more channels are available but not given in this message."]
24797 pub count: u8,
24798 #[doc = "RC channels. Channel values are in centered 13 bit format. Range is -4096 to 4096, center is 0. Conversion to PWM is x * 5/32 + 1500. Channels with indexes equal or above count should be set to 0, to benefit from MAVLink's trailing-zero trimming."]
24799 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24800 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24801 pub channels: [i16; 32],
24802}
24803impl RADIO_RC_CHANNELS_DATA {
24804 pub const ENCODED_LEN: usize = 73usize;
24805 pub const DEFAULT: Self = Self {
24806 time_last_update_ms: 0_u32,
24807 flags: RadioRcChannelsFlags::DEFAULT,
24808 target_system: 0_u8,
24809 target_component: 0_u8,
24810 count: 0_u8,
24811 channels: [0_i16; 32usize],
24812 };
24813 #[cfg(feature = "arbitrary")]
24814 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24815 use arbitrary::{Arbitrary, Unstructured};
24816 let mut buf = [0u8; 1024];
24817 rng.fill_bytes(&mut buf);
24818 let mut unstructured = Unstructured::new(&buf);
24819 Self::arbitrary(&mut unstructured).unwrap_or_default()
24820 }
24821}
24822impl Default for RADIO_RC_CHANNELS_DATA {
24823 fn default() -> Self {
24824 Self::DEFAULT.clone()
24825 }
24826}
24827impl MessageData for RADIO_RC_CHANNELS_DATA {
24828 type Message = MavMessage;
24829 const ID: u32 = 420u32;
24830 const NAME: &'static str = "RADIO_RC_CHANNELS";
24831 const EXTRA_CRC: u8 = 20u8;
24832 const ENCODED_LEN: usize = 73usize;
24833 fn deser(
24834 _version: MavlinkVersion,
24835 __input: &[u8],
24836 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24837 let avail_len = __input.len();
24838 let mut payload_buf = [0; Self::ENCODED_LEN];
24839 let mut buf = if avail_len < Self::ENCODED_LEN {
24840 payload_buf[0..avail_len].copy_from_slice(__input);
24841 Bytes::new(&payload_buf)
24842 } else {
24843 Bytes::new(__input)
24844 };
24845 let mut __struct = Self::default();
24846 __struct.time_last_update_ms = buf.get_u32_le();
24847 let tmp = buf.get_u16_le();
24848 __struct.flags = RadioRcChannelsFlags::from_bits(tmp & RadioRcChannelsFlags::all().bits())
24849 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24850 flag_type: "RadioRcChannelsFlags",
24851 value: tmp as u32,
24852 })?;
24853 __struct.target_system = buf.get_u8();
24854 __struct.target_component = buf.get_u8();
24855 __struct.count = buf.get_u8();
24856 for v in &mut __struct.channels {
24857 let val = buf.get_i16_le();
24858 *v = val;
24859 }
24860 Ok(__struct)
24861 }
24862 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24863 let mut __tmp = BytesMut::new(bytes);
24864 #[allow(clippy::absurd_extreme_comparisons)]
24865 #[allow(unused_comparisons)]
24866 if __tmp.remaining() < Self::ENCODED_LEN {
24867 panic!(
24868 "buffer is too small (need {} bytes, but got {})",
24869 Self::ENCODED_LEN,
24870 __tmp.remaining(),
24871 )
24872 }
24873 __tmp.put_u32_le(self.time_last_update_ms);
24874 __tmp.put_u16_le(self.flags.bits());
24875 __tmp.put_u8(self.target_system);
24876 __tmp.put_u8(self.target_component);
24877 __tmp.put_u8(self.count);
24878 for val in &self.channels {
24879 __tmp.put_i16_le(*val);
24880 }
24881 if matches!(version, MavlinkVersion::V2) {
24882 let len = __tmp.len();
24883 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24884 } else {
24885 __tmp.len()
24886 }
24887 }
24888}
24889#[doc = "id: 109"]
24890#[doc = "Status generated by radio and injected into MAVLink stream."]
24891#[derive(Debug, Clone, PartialEq)]
24892#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24893#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24894pub struct RADIO_STATUS_DATA {
24895 #[doc = "Count of radio packet receive errors (since boot)."]
24896 pub rxerrors: u16,
24897 #[doc = "Count of error corrected radio packets (since boot)."]
24898 pub fixed: u16,
24899 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24900 pub rssi: u8,
24901 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24902 pub remrssi: u8,
24903 #[doc = "Remaining free transmitter buffer space."]
24904 pub txbuf: u8,
24905 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24906 pub noise: u8,
24907 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24908 pub remnoise: u8,
24909}
24910impl RADIO_STATUS_DATA {
24911 pub const ENCODED_LEN: usize = 9usize;
24912 pub const DEFAULT: Self = Self {
24913 rxerrors: 0_u16,
24914 fixed: 0_u16,
24915 rssi: 0_u8,
24916 remrssi: 0_u8,
24917 txbuf: 0_u8,
24918 noise: 0_u8,
24919 remnoise: 0_u8,
24920 };
24921 #[cfg(feature = "arbitrary")]
24922 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24923 use arbitrary::{Arbitrary, Unstructured};
24924 let mut buf = [0u8; 1024];
24925 rng.fill_bytes(&mut buf);
24926 let mut unstructured = Unstructured::new(&buf);
24927 Self::arbitrary(&mut unstructured).unwrap_or_default()
24928 }
24929}
24930impl Default for RADIO_STATUS_DATA {
24931 fn default() -> Self {
24932 Self::DEFAULT.clone()
24933 }
24934}
24935impl MessageData for RADIO_STATUS_DATA {
24936 type Message = MavMessage;
24937 const ID: u32 = 109u32;
24938 const NAME: &'static str = "RADIO_STATUS";
24939 const EXTRA_CRC: u8 = 185u8;
24940 const ENCODED_LEN: usize = 9usize;
24941 fn deser(
24942 _version: MavlinkVersion,
24943 __input: &[u8],
24944 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24945 let avail_len = __input.len();
24946 let mut payload_buf = [0; Self::ENCODED_LEN];
24947 let mut buf = if avail_len < Self::ENCODED_LEN {
24948 payload_buf[0..avail_len].copy_from_slice(__input);
24949 Bytes::new(&payload_buf)
24950 } else {
24951 Bytes::new(__input)
24952 };
24953 let mut __struct = Self::default();
24954 __struct.rxerrors = buf.get_u16_le();
24955 __struct.fixed = buf.get_u16_le();
24956 __struct.rssi = buf.get_u8();
24957 __struct.remrssi = buf.get_u8();
24958 __struct.txbuf = buf.get_u8();
24959 __struct.noise = buf.get_u8();
24960 __struct.remnoise = buf.get_u8();
24961 Ok(__struct)
24962 }
24963 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24964 let mut __tmp = BytesMut::new(bytes);
24965 #[allow(clippy::absurd_extreme_comparisons)]
24966 #[allow(unused_comparisons)]
24967 if __tmp.remaining() < Self::ENCODED_LEN {
24968 panic!(
24969 "buffer is too small (need {} bytes, but got {})",
24970 Self::ENCODED_LEN,
24971 __tmp.remaining(),
24972 )
24973 }
24974 __tmp.put_u16_le(self.rxerrors);
24975 __tmp.put_u16_le(self.fixed);
24976 __tmp.put_u8(self.rssi);
24977 __tmp.put_u8(self.remrssi);
24978 __tmp.put_u8(self.txbuf);
24979 __tmp.put_u8(self.noise);
24980 __tmp.put_u8(self.remnoise);
24981 if matches!(version, MavlinkVersion::V2) {
24982 let len = __tmp.len();
24983 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24984 } else {
24985 __tmp.len()
24986 }
24987 }
24988}
24989#[doc = "id: 27"]
24990#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
24991#[derive(Debug, Clone, PartialEq)]
24992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24993#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24994pub struct RAW_IMU_DATA {
24995 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24996 pub time_usec: u64,
24997 #[doc = "X acceleration (raw)"]
24998 pub xacc: i16,
24999 #[doc = "Y acceleration (raw)"]
25000 pub yacc: i16,
25001 #[doc = "Z acceleration (raw)"]
25002 pub zacc: i16,
25003 #[doc = "Angular speed around X axis (raw)"]
25004 pub xgyro: i16,
25005 #[doc = "Angular speed around Y axis (raw)"]
25006 pub ygyro: i16,
25007 #[doc = "Angular speed around Z axis (raw)"]
25008 pub zgyro: i16,
25009 #[doc = "X Magnetic field (raw)"]
25010 pub xmag: i16,
25011 #[doc = "Y Magnetic field (raw)"]
25012 pub ymag: i16,
25013 #[doc = "Z Magnetic field (raw)"]
25014 pub zmag: i16,
25015 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25016 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25017 pub id: u8,
25018 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25019 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25020 pub temperature: i16,
25021}
25022impl RAW_IMU_DATA {
25023 pub const ENCODED_LEN: usize = 29usize;
25024 pub const DEFAULT: Self = Self {
25025 time_usec: 0_u64,
25026 xacc: 0_i16,
25027 yacc: 0_i16,
25028 zacc: 0_i16,
25029 xgyro: 0_i16,
25030 ygyro: 0_i16,
25031 zgyro: 0_i16,
25032 xmag: 0_i16,
25033 ymag: 0_i16,
25034 zmag: 0_i16,
25035 id: 0_u8,
25036 temperature: 0_i16,
25037 };
25038 #[cfg(feature = "arbitrary")]
25039 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25040 use arbitrary::{Arbitrary, Unstructured};
25041 let mut buf = [0u8; 1024];
25042 rng.fill_bytes(&mut buf);
25043 let mut unstructured = Unstructured::new(&buf);
25044 Self::arbitrary(&mut unstructured).unwrap_or_default()
25045 }
25046}
25047impl Default for RAW_IMU_DATA {
25048 fn default() -> Self {
25049 Self::DEFAULT.clone()
25050 }
25051}
25052impl MessageData for RAW_IMU_DATA {
25053 type Message = MavMessage;
25054 const ID: u32 = 27u32;
25055 const NAME: &'static str = "RAW_IMU";
25056 const EXTRA_CRC: u8 = 144u8;
25057 const ENCODED_LEN: usize = 29usize;
25058 fn deser(
25059 _version: MavlinkVersion,
25060 __input: &[u8],
25061 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25062 let avail_len = __input.len();
25063 let mut payload_buf = [0; Self::ENCODED_LEN];
25064 let mut buf = if avail_len < Self::ENCODED_LEN {
25065 payload_buf[0..avail_len].copy_from_slice(__input);
25066 Bytes::new(&payload_buf)
25067 } else {
25068 Bytes::new(__input)
25069 };
25070 let mut __struct = Self::default();
25071 __struct.time_usec = buf.get_u64_le();
25072 __struct.xacc = buf.get_i16_le();
25073 __struct.yacc = buf.get_i16_le();
25074 __struct.zacc = buf.get_i16_le();
25075 __struct.xgyro = buf.get_i16_le();
25076 __struct.ygyro = buf.get_i16_le();
25077 __struct.zgyro = buf.get_i16_le();
25078 __struct.xmag = buf.get_i16_le();
25079 __struct.ymag = buf.get_i16_le();
25080 __struct.zmag = buf.get_i16_le();
25081 __struct.id = buf.get_u8();
25082 __struct.temperature = buf.get_i16_le();
25083 Ok(__struct)
25084 }
25085 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25086 let mut __tmp = BytesMut::new(bytes);
25087 #[allow(clippy::absurd_extreme_comparisons)]
25088 #[allow(unused_comparisons)]
25089 if __tmp.remaining() < Self::ENCODED_LEN {
25090 panic!(
25091 "buffer is too small (need {} bytes, but got {})",
25092 Self::ENCODED_LEN,
25093 __tmp.remaining(),
25094 )
25095 }
25096 __tmp.put_u64_le(self.time_usec);
25097 __tmp.put_i16_le(self.xacc);
25098 __tmp.put_i16_le(self.yacc);
25099 __tmp.put_i16_le(self.zacc);
25100 __tmp.put_i16_le(self.xgyro);
25101 __tmp.put_i16_le(self.ygyro);
25102 __tmp.put_i16_le(self.zgyro);
25103 __tmp.put_i16_le(self.xmag);
25104 __tmp.put_i16_le(self.ymag);
25105 __tmp.put_i16_le(self.zmag);
25106 __tmp.put_u8(self.id);
25107 __tmp.put_i16_le(self.temperature);
25108 if matches!(version, MavlinkVersion::V2) {
25109 let len = __tmp.len();
25110 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25111 } else {
25112 __tmp.len()
25113 }
25114 }
25115}
25116#[doc = "id: 28"]
25117#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25118#[derive(Debug, Clone, PartialEq)]
25119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25121pub struct RAW_PRESSURE_DATA {
25122 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25123 pub time_usec: u64,
25124 #[doc = "Absolute pressure (raw)"]
25125 pub press_abs: i16,
25126 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25127 pub press_diff1: i16,
25128 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25129 pub press_diff2: i16,
25130 #[doc = "Raw Temperature measurement (raw)"]
25131 pub temperature: i16,
25132}
25133impl RAW_PRESSURE_DATA {
25134 pub const ENCODED_LEN: usize = 16usize;
25135 pub const DEFAULT: Self = Self {
25136 time_usec: 0_u64,
25137 press_abs: 0_i16,
25138 press_diff1: 0_i16,
25139 press_diff2: 0_i16,
25140 temperature: 0_i16,
25141 };
25142 #[cfg(feature = "arbitrary")]
25143 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25144 use arbitrary::{Arbitrary, Unstructured};
25145 let mut buf = [0u8; 1024];
25146 rng.fill_bytes(&mut buf);
25147 let mut unstructured = Unstructured::new(&buf);
25148 Self::arbitrary(&mut unstructured).unwrap_or_default()
25149 }
25150}
25151impl Default for RAW_PRESSURE_DATA {
25152 fn default() -> Self {
25153 Self::DEFAULT.clone()
25154 }
25155}
25156impl MessageData for RAW_PRESSURE_DATA {
25157 type Message = MavMessage;
25158 const ID: u32 = 28u32;
25159 const NAME: &'static str = "RAW_PRESSURE";
25160 const EXTRA_CRC: u8 = 67u8;
25161 const ENCODED_LEN: usize = 16usize;
25162 fn deser(
25163 _version: MavlinkVersion,
25164 __input: &[u8],
25165 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25166 let avail_len = __input.len();
25167 let mut payload_buf = [0; Self::ENCODED_LEN];
25168 let mut buf = if avail_len < Self::ENCODED_LEN {
25169 payload_buf[0..avail_len].copy_from_slice(__input);
25170 Bytes::new(&payload_buf)
25171 } else {
25172 Bytes::new(__input)
25173 };
25174 let mut __struct = Self::default();
25175 __struct.time_usec = buf.get_u64_le();
25176 __struct.press_abs = buf.get_i16_le();
25177 __struct.press_diff1 = buf.get_i16_le();
25178 __struct.press_diff2 = buf.get_i16_le();
25179 __struct.temperature = buf.get_i16_le();
25180 Ok(__struct)
25181 }
25182 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25183 let mut __tmp = BytesMut::new(bytes);
25184 #[allow(clippy::absurd_extreme_comparisons)]
25185 #[allow(unused_comparisons)]
25186 if __tmp.remaining() < Self::ENCODED_LEN {
25187 panic!(
25188 "buffer is too small (need {} bytes, but got {})",
25189 Self::ENCODED_LEN,
25190 __tmp.remaining(),
25191 )
25192 }
25193 __tmp.put_u64_le(self.time_usec);
25194 __tmp.put_i16_le(self.press_abs);
25195 __tmp.put_i16_le(self.press_diff1);
25196 __tmp.put_i16_le(self.press_diff2);
25197 __tmp.put_i16_le(self.temperature);
25198 if matches!(version, MavlinkVersion::V2) {
25199 let len = __tmp.len();
25200 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25201 } else {
25202 __tmp.len()
25203 }
25204 }
25205}
25206#[doc = "id: 339"]
25207#[doc = "RPM sensor data message."]
25208#[derive(Debug, Clone, PartialEq)]
25209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25211pub struct RAW_RPM_DATA {
25212 #[doc = "Indicated rate"]
25213 pub frequency: f32,
25214 #[doc = "Index of this RPM sensor (0-indexed)"]
25215 pub index: u8,
25216}
25217impl RAW_RPM_DATA {
25218 pub const ENCODED_LEN: usize = 5usize;
25219 pub const DEFAULT: Self = Self {
25220 frequency: 0.0_f32,
25221 index: 0_u8,
25222 };
25223 #[cfg(feature = "arbitrary")]
25224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25225 use arbitrary::{Arbitrary, Unstructured};
25226 let mut buf = [0u8; 1024];
25227 rng.fill_bytes(&mut buf);
25228 let mut unstructured = Unstructured::new(&buf);
25229 Self::arbitrary(&mut unstructured).unwrap_or_default()
25230 }
25231}
25232impl Default for RAW_RPM_DATA {
25233 fn default() -> Self {
25234 Self::DEFAULT.clone()
25235 }
25236}
25237impl MessageData for RAW_RPM_DATA {
25238 type Message = MavMessage;
25239 const ID: u32 = 339u32;
25240 const NAME: &'static str = "RAW_RPM";
25241 const EXTRA_CRC: u8 = 199u8;
25242 const ENCODED_LEN: usize = 5usize;
25243 fn deser(
25244 _version: MavlinkVersion,
25245 __input: &[u8],
25246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25247 let avail_len = __input.len();
25248 let mut payload_buf = [0; Self::ENCODED_LEN];
25249 let mut buf = if avail_len < Self::ENCODED_LEN {
25250 payload_buf[0..avail_len].copy_from_slice(__input);
25251 Bytes::new(&payload_buf)
25252 } else {
25253 Bytes::new(__input)
25254 };
25255 let mut __struct = Self::default();
25256 __struct.frequency = buf.get_f32_le();
25257 __struct.index = buf.get_u8();
25258 Ok(__struct)
25259 }
25260 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25261 let mut __tmp = BytesMut::new(bytes);
25262 #[allow(clippy::absurd_extreme_comparisons)]
25263 #[allow(unused_comparisons)]
25264 if __tmp.remaining() < Self::ENCODED_LEN {
25265 panic!(
25266 "buffer is too small (need {} bytes, but got {})",
25267 Self::ENCODED_LEN,
25268 __tmp.remaining(),
25269 )
25270 }
25271 __tmp.put_f32_le(self.frequency);
25272 __tmp.put_u8(self.index);
25273 if matches!(version, MavlinkVersion::V2) {
25274 let len = __tmp.len();
25275 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25276 } else {
25277 __tmp.len()
25278 }
25279 }
25280}
25281#[doc = "id: 65"]
25282#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25283#[derive(Debug, Clone, PartialEq)]
25284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25285#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25286pub struct RC_CHANNELS_DATA {
25287 #[doc = "Timestamp (time since system boot)."]
25288 pub time_boot_ms: u32,
25289 #[doc = "RC channel 1 value."]
25290 pub chan1_raw: u16,
25291 #[doc = "RC channel 2 value."]
25292 pub chan2_raw: u16,
25293 #[doc = "RC channel 3 value."]
25294 pub chan3_raw: u16,
25295 #[doc = "RC channel 4 value."]
25296 pub chan4_raw: u16,
25297 #[doc = "RC channel 5 value."]
25298 pub chan5_raw: u16,
25299 #[doc = "RC channel 6 value."]
25300 pub chan6_raw: u16,
25301 #[doc = "RC channel 7 value."]
25302 pub chan7_raw: u16,
25303 #[doc = "RC channel 8 value."]
25304 pub chan8_raw: u16,
25305 #[doc = "RC channel 9 value."]
25306 pub chan9_raw: u16,
25307 #[doc = "RC channel 10 value."]
25308 pub chan10_raw: u16,
25309 #[doc = "RC channel 11 value."]
25310 pub chan11_raw: u16,
25311 #[doc = "RC channel 12 value."]
25312 pub chan12_raw: u16,
25313 #[doc = "RC channel 13 value."]
25314 pub chan13_raw: u16,
25315 #[doc = "RC channel 14 value."]
25316 pub chan14_raw: u16,
25317 #[doc = "RC channel 15 value."]
25318 pub chan15_raw: u16,
25319 #[doc = "RC channel 16 value."]
25320 pub chan16_raw: u16,
25321 #[doc = "RC channel 17 value."]
25322 pub chan17_raw: u16,
25323 #[doc = "RC channel 18 value."]
25324 pub chan18_raw: u16,
25325 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25326 pub chancount: u8,
25327 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25328 pub rssi: u8,
25329}
25330impl RC_CHANNELS_DATA {
25331 pub const ENCODED_LEN: usize = 42usize;
25332 pub const DEFAULT: Self = Self {
25333 time_boot_ms: 0_u32,
25334 chan1_raw: 0_u16,
25335 chan2_raw: 0_u16,
25336 chan3_raw: 0_u16,
25337 chan4_raw: 0_u16,
25338 chan5_raw: 0_u16,
25339 chan6_raw: 0_u16,
25340 chan7_raw: 0_u16,
25341 chan8_raw: 0_u16,
25342 chan9_raw: 0_u16,
25343 chan10_raw: 0_u16,
25344 chan11_raw: 0_u16,
25345 chan12_raw: 0_u16,
25346 chan13_raw: 0_u16,
25347 chan14_raw: 0_u16,
25348 chan15_raw: 0_u16,
25349 chan16_raw: 0_u16,
25350 chan17_raw: 0_u16,
25351 chan18_raw: 0_u16,
25352 chancount: 0_u8,
25353 rssi: 0_u8,
25354 };
25355 #[cfg(feature = "arbitrary")]
25356 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25357 use arbitrary::{Arbitrary, Unstructured};
25358 let mut buf = [0u8; 1024];
25359 rng.fill_bytes(&mut buf);
25360 let mut unstructured = Unstructured::new(&buf);
25361 Self::arbitrary(&mut unstructured).unwrap_or_default()
25362 }
25363}
25364impl Default for RC_CHANNELS_DATA {
25365 fn default() -> Self {
25366 Self::DEFAULT.clone()
25367 }
25368}
25369impl MessageData for RC_CHANNELS_DATA {
25370 type Message = MavMessage;
25371 const ID: u32 = 65u32;
25372 const NAME: &'static str = "RC_CHANNELS";
25373 const EXTRA_CRC: u8 = 118u8;
25374 const ENCODED_LEN: usize = 42usize;
25375 fn deser(
25376 _version: MavlinkVersion,
25377 __input: &[u8],
25378 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25379 let avail_len = __input.len();
25380 let mut payload_buf = [0; Self::ENCODED_LEN];
25381 let mut buf = if avail_len < Self::ENCODED_LEN {
25382 payload_buf[0..avail_len].copy_from_slice(__input);
25383 Bytes::new(&payload_buf)
25384 } else {
25385 Bytes::new(__input)
25386 };
25387 let mut __struct = Self::default();
25388 __struct.time_boot_ms = buf.get_u32_le();
25389 __struct.chan1_raw = buf.get_u16_le();
25390 __struct.chan2_raw = buf.get_u16_le();
25391 __struct.chan3_raw = buf.get_u16_le();
25392 __struct.chan4_raw = buf.get_u16_le();
25393 __struct.chan5_raw = buf.get_u16_le();
25394 __struct.chan6_raw = buf.get_u16_le();
25395 __struct.chan7_raw = buf.get_u16_le();
25396 __struct.chan8_raw = buf.get_u16_le();
25397 __struct.chan9_raw = buf.get_u16_le();
25398 __struct.chan10_raw = buf.get_u16_le();
25399 __struct.chan11_raw = buf.get_u16_le();
25400 __struct.chan12_raw = buf.get_u16_le();
25401 __struct.chan13_raw = buf.get_u16_le();
25402 __struct.chan14_raw = buf.get_u16_le();
25403 __struct.chan15_raw = buf.get_u16_le();
25404 __struct.chan16_raw = buf.get_u16_le();
25405 __struct.chan17_raw = buf.get_u16_le();
25406 __struct.chan18_raw = buf.get_u16_le();
25407 __struct.chancount = buf.get_u8();
25408 __struct.rssi = buf.get_u8();
25409 Ok(__struct)
25410 }
25411 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25412 let mut __tmp = BytesMut::new(bytes);
25413 #[allow(clippy::absurd_extreme_comparisons)]
25414 #[allow(unused_comparisons)]
25415 if __tmp.remaining() < Self::ENCODED_LEN {
25416 panic!(
25417 "buffer is too small (need {} bytes, but got {})",
25418 Self::ENCODED_LEN,
25419 __tmp.remaining(),
25420 )
25421 }
25422 __tmp.put_u32_le(self.time_boot_ms);
25423 __tmp.put_u16_le(self.chan1_raw);
25424 __tmp.put_u16_le(self.chan2_raw);
25425 __tmp.put_u16_le(self.chan3_raw);
25426 __tmp.put_u16_le(self.chan4_raw);
25427 __tmp.put_u16_le(self.chan5_raw);
25428 __tmp.put_u16_le(self.chan6_raw);
25429 __tmp.put_u16_le(self.chan7_raw);
25430 __tmp.put_u16_le(self.chan8_raw);
25431 __tmp.put_u16_le(self.chan9_raw);
25432 __tmp.put_u16_le(self.chan10_raw);
25433 __tmp.put_u16_le(self.chan11_raw);
25434 __tmp.put_u16_le(self.chan12_raw);
25435 __tmp.put_u16_le(self.chan13_raw);
25436 __tmp.put_u16_le(self.chan14_raw);
25437 __tmp.put_u16_le(self.chan15_raw);
25438 __tmp.put_u16_le(self.chan16_raw);
25439 __tmp.put_u16_le(self.chan17_raw);
25440 __tmp.put_u16_le(self.chan18_raw);
25441 __tmp.put_u8(self.chancount);
25442 __tmp.put_u8(self.rssi);
25443 if matches!(version, MavlinkVersion::V2) {
25444 let len = __tmp.len();
25445 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25446 } else {
25447 __tmp.len()
25448 }
25449 }
25450}
25451#[doc = "id: 70"]
25452#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25453#[derive(Debug, Clone, PartialEq)]
25454#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25455#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25456pub struct RC_CHANNELS_OVERRIDE_DATA {
25457 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25458 pub chan1_raw: u16,
25459 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25460 pub chan2_raw: u16,
25461 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25462 pub chan3_raw: u16,
25463 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25464 pub chan4_raw: u16,
25465 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25466 pub chan5_raw: u16,
25467 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25468 pub chan6_raw: u16,
25469 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25470 pub chan7_raw: u16,
25471 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25472 pub chan8_raw: u16,
25473 #[doc = "System ID"]
25474 pub target_system: u8,
25475 #[doc = "Component ID"]
25476 pub target_component: u8,
25477 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25478 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25479 pub chan9_raw: u16,
25480 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25481 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25482 pub chan10_raw: u16,
25483 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25484 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25485 pub chan11_raw: u16,
25486 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25487 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25488 pub chan12_raw: u16,
25489 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25490 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25491 pub chan13_raw: u16,
25492 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25493 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25494 pub chan14_raw: u16,
25495 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25496 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25497 pub chan15_raw: u16,
25498 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25499 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25500 pub chan16_raw: u16,
25501 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25502 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25503 pub chan17_raw: u16,
25504 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25505 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25506 pub chan18_raw: u16,
25507}
25508impl RC_CHANNELS_OVERRIDE_DATA {
25509 pub const ENCODED_LEN: usize = 38usize;
25510 pub const DEFAULT: Self = Self {
25511 chan1_raw: 0_u16,
25512 chan2_raw: 0_u16,
25513 chan3_raw: 0_u16,
25514 chan4_raw: 0_u16,
25515 chan5_raw: 0_u16,
25516 chan6_raw: 0_u16,
25517 chan7_raw: 0_u16,
25518 chan8_raw: 0_u16,
25519 target_system: 0_u8,
25520 target_component: 0_u8,
25521 chan9_raw: 0_u16,
25522 chan10_raw: 0_u16,
25523 chan11_raw: 0_u16,
25524 chan12_raw: 0_u16,
25525 chan13_raw: 0_u16,
25526 chan14_raw: 0_u16,
25527 chan15_raw: 0_u16,
25528 chan16_raw: 0_u16,
25529 chan17_raw: 0_u16,
25530 chan18_raw: 0_u16,
25531 };
25532 #[cfg(feature = "arbitrary")]
25533 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25534 use arbitrary::{Arbitrary, Unstructured};
25535 let mut buf = [0u8; 1024];
25536 rng.fill_bytes(&mut buf);
25537 let mut unstructured = Unstructured::new(&buf);
25538 Self::arbitrary(&mut unstructured).unwrap_or_default()
25539 }
25540}
25541impl Default for RC_CHANNELS_OVERRIDE_DATA {
25542 fn default() -> Self {
25543 Self::DEFAULT.clone()
25544 }
25545}
25546impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25547 type Message = MavMessage;
25548 const ID: u32 = 70u32;
25549 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25550 const EXTRA_CRC: u8 = 124u8;
25551 const ENCODED_LEN: usize = 38usize;
25552 fn deser(
25553 _version: MavlinkVersion,
25554 __input: &[u8],
25555 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25556 let avail_len = __input.len();
25557 let mut payload_buf = [0; Self::ENCODED_LEN];
25558 let mut buf = if avail_len < Self::ENCODED_LEN {
25559 payload_buf[0..avail_len].copy_from_slice(__input);
25560 Bytes::new(&payload_buf)
25561 } else {
25562 Bytes::new(__input)
25563 };
25564 let mut __struct = Self::default();
25565 __struct.chan1_raw = buf.get_u16_le();
25566 __struct.chan2_raw = buf.get_u16_le();
25567 __struct.chan3_raw = buf.get_u16_le();
25568 __struct.chan4_raw = buf.get_u16_le();
25569 __struct.chan5_raw = buf.get_u16_le();
25570 __struct.chan6_raw = buf.get_u16_le();
25571 __struct.chan7_raw = buf.get_u16_le();
25572 __struct.chan8_raw = buf.get_u16_le();
25573 __struct.target_system = buf.get_u8();
25574 __struct.target_component = buf.get_u8();
25575 __struct.chan9_raw = buf.get_u16_le();
25576 __struct.chan10_raw = buf.get_u16_le();
25577 __struct.chan11_raw = buf.get_u16_le();
25578 __struct.chan12_raw = buf.get_u16_le();
25579 __struct.chan13_raw = buf.get_u16_le();
25580 __struct.chan14_raw = buf.get_u16_le();
25581 __struct.chan15_raw = buf.get_u16_le();
25582 __struct.chan16_raw = buf.get_u16_le();
25583 __struct.chan17_raw = buf.get_u16_le();
25584 __struct.chan18_raw = buf.get_u16_le();
25585 Ok(__struct)
25586 }
25587 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25588 let mut __tmp = BytesMut::new(bytes);
25589 #[allow(clippy::absurd_extreme_comparisons)]
25590 #[allow(unused_comparisons)]
25591 if __tmp.remaining() < Self::ENCODED_LEN {
25592 panic!(
25593 "buffer is too small (need {} bytes, but got {})",
25594 Self::ENCODED_LEN,
25595 __tmp.remaining(),
25596 )
25597 }
25598 __tmp.put_u16_le(self.chan1_raw);
25599 __tmp.put_u16_le(self.chan2_raw);
25600 __tmp.put_u16_le(self.chan3_raw);
25601 __tmp.put_u16_le(self.chan4_raw);
25602 __tmp.put_u16_le(self.chan5_raw);
25603 __tmp.put_u16_le(self.chan6_raw);
25604 __tmp.put_u16_le(self.chan7_raw);
25605 __tmp.put_u16_le(self.chan8_raw);
25606 __tmp.put_u8(self.target_system);
25607 __tmp.put_u8(self.target_component);
25608 __tmp.put_u16_le(self.chan9_raw);
25609 __tmp.put_u16_le(self.chan10_raw);
25610 __tmp.put_u16_le(self.chan11_raw);
25611 __tmp.put_u16_le(self.chan12_raw);
25612 __tmp.put_u16_le(self.chan13_raw);
25613 __tmp.put_u16_le(self.chan14_raw);
25614 __tmp.put_u16_le(self.chan15_raw);
25615 __tmp.put_u16_le(self.chan16_raw);
25616 __tmp.put_u16_le(self.chan17_raw);
25617 __tmp.put_u16_le(self.chan18_raw);
25618 if matches!(version, MavlinkVersion::V2) {
25619 let len = __tmp.len();
25620 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25621 } else {
25622 __tmp.len()
25623 }
25624 }
25625}
25626#[doc = "id: 35"]
25627#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25628#[derive(Debug, Clone, PartialEq)]
25629#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25630#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25631pub struct RC_CHANNELS_RAW_DATA {
25632 #[doc = "Timestamp (time since system boot)."]
25633 pub time_boot_ms: u32,
25634 #[doc = "RC channel 1 value."]
25635 pub chan1_raw: u16,
25636 #[doc = "RC channel 2 value."]
25637 pub chan2_raw: u16,
25638 #[doc = "RC channel 3 value."]
25639 pub chan3_raw: u16,
25640 #[doc = "RC channel 4 value."]
25641 pub chan4_raw: u16,
25642 #[doc = "RC channel 5 value."]
25643 pub chan5_raw: u16,
25644 #[doc = "RC channel 6 value."]
25645 pub chan6_raw: u16,
25646 #[doc = "RC channel 7 value."]
25647 pub chan7_raw: u16,
25648 #[doc = "RC channel 8 value."]
25649 pub chan8_raw: u16,
25650 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25651 pub port: u8,
25652 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25653 pub rssi: u8,
25654}
25655impl RC_CHANNELS_RAW_DATA {
25656 pub const ENCODED_LEN: usize = 22usize;
25657 pub const DEFAULT: Self = Self {
25658 time_boot_ms: 0_u32,
25659 chan1_raw: 0_u16,
25660 chan2_raw: 0_u16,
25661 chan3_raw: 0_u16,
25662 chan4_raw: 0_u16,
25663 chan5_raw: 0_u16,
25664 chan6_raw: 0_u16,
25665 chan7_raw: 0_u16,
25666 chan8_raw: 0_u16,
25667 port: 0_u8,
25668 rssi: 0_u8,
25669 };
25670 #[cfg(feature = "arbitrary")]
25671 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25672 use arbitrary::{Arbitrary, Unstructured};
25673 let mut buf = [0u8; 1024];
25674 rng.fill_bytes(&mut buf);
25675 let mut unstructured = Unstructured::new(&buf);
25676 Self::arbitrary(&mut unstructured).unwrap_or_default()
25677 }
25678}
25679impl Default for RC_CHANNELS_RAW_DATA {
25680 fn default() -> Self {
25681 Self::DEFAULT.clone()
25682 }
25683}
25684impl MessageData for RC_CHANNELS_RAW_DATA {
25685 type Message = MavMessage;
25686 const ID: u32 = 35u32;
25687 const NAME: &'static str = "RC_CHANNELS_RAW";
25688 const EXTRA_CRC: u8 = 244u8;
25689 const ENCODED_LEN: usize = 22usize;
25690 fn deser(
25691 _version: MavlinkVersion,
25692 __input: &[u8],
25693 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25694 let avail_len = __input.len();
25695 let mut payload_buf = [0; Self::ENCODED_LEN];
25696 let mut buf = if avail_len < Self::ENCODED_LEN {
25697 payload_buf[0..avail_len].copy_from_slice(__input);
25698 Bytes::new(&payload_buf)
25699 } else {
25700 Bytes::new(__input)
25701 };
25702 let mut __struct = Self::default();
25703 __struct.time_boot_ms = buf.get_u32_le();
25704 __struct.chan1_raw = buf.get_u16_le();
25705 __struct.chan2_raw = buf.get_u16_le();
25706 __struct.chan3_raw = buf.get_u16_le();
25707 __struct.chan4_raw = buf.get_u16_le();
25708 __struct.chan5_raw = buf.get_u16_le();
25709 __struct.chan6_raw = buf.get_u16_le();
25710 __struct.chan7_raw = buf.get_u16_le();
25711 __struct.chan8_raw = buf.get_u16_le();
25712 __struct.port = buf.get_u8();
25713 __struct.rssi = buf.get_u8();
25714 Ok(__struct)
25715 }
25716 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25717 let mut __tmp = BytesMut::new(bytes);
25718 #[allow(clippy::absurd_extreme_comparisons)]
25719 #[allow(unused_comparisons)]
25720 if __tmp.remaining() < Self::ENCODED_LEN {
25721 panic!(
25722 "buffer is too small (need {} bytes, but got {})",
25723 Self::ENCODED_LEN,
25724 __tmp.remaining(),
25725 )
25726 }
25727 __tmp.put_u32_le(self.time_boot_ms);
25728 __tmp.put_u16_le(self.chan1_raw);
25729 __tmp.put_u16_le(self.chan2_raw);
25730 __tmp.put_u16_le(self.chan3_raw);
25731 __tmp.put_u16_le(self.chan4_raw);
25732 __tmp.put_u16_le(self.chan5_raw);
25733 __tmp.put_u16_le(self.chan6_raw);
25734 __tmp.put_u16_le(self.chan7_raw);
25735 __tmp.put_u16_le(self.chan8_raw);
25736 __tmp.put_u8(self.port);
25737 __tmp.put_u8(self.rssi);
25738 if matches!(version, MavlinkVersion::V2) {
25739 let len = __tmp.len();
25740 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25741 } else {
25742 __tmp.len()
25743 }
25744 }
25745}
25746#[doc = "id: 34"]
25747#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
25748#[derive(Debug, Clone, PartialEq)]
25749#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25751pub struct RC_CHANNELS_SCALED_DATA {
25752 #[doc = "Timestamp (time since system boot)."]
25753 pub time_boot_ms: u32,
25754 #[doc = "RC channel 1 value scaled."]
25755 pub chan1_scaled: i16,
25756 #[doc = "RC channel 2 value scaled."]
25757 pub chan2_scaled: i16,
25758 #[doc = "RC channel 3 value scaled."]
25759 pub chan3_scaled: i16,
25760 #[doc = "RC channel 4 value scaled."]
25761 pub chan4_scaled: i16,
25762 #[doc = "RC channel 5 value scaled."]
25763 pub chan5_scaled: i16,
25764 #[doc = "RC channel 6 value scaled."]
25765 pub chan6_scaled: i16,
25766 #[doc = "RC channel 7 value scaled."]
25767 pub chan7_scaled: i16,
25768 #[doc = "RC channel 8 value scaled."]
25769 pub chan8_scaled: i16,
25770 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25771 pub port: u8,
25772 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25773 pub rssi: u8,
25774}
25775impl RC_CHANNELS_SCALED_DATA {
25776 pub const ENCODED_LEN: usize = 22usize;
25777 pub const DEFAULT: Self = Self {
25778 time_boot_ms: 0_u32,
25779 chan1_scaled: 0_i16,
25780 chan2_scaled: 0_i16,
25781 chan3_scaled: 0_i16,
25782 chan4_scaled: 0_i16,
25783 chan5_scaled: 0_i16,
25784 chan6_scaled: 0_i16,
25785 chan7_scaled: 0_i16,
25786 chan8_scaled: 0_i16,
25787 port: 0_u8,
25788 rssi: 0_u8,
25789 };
25790 #[cfg(feature = "arbitrary")]
25791 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25792 use arbitrary::{Arbitrary, Unstructured};
25793 let mut buf = [0u8; 1024];
25794 rng.fill_bytes(&mut buf);
25795 let mut unstructured = Unstructured::new(&buf);
25796 Self::arbitrary(&mut unstructured).unwrap_or_default()
25797 }
25798}
25799impl Default for RC_CHANNELS_SCALED_DATA {
25800 fn default() -> Self {
25801 Self::DEFAULT.clone()
25802 }
25803}
25804impl MessageData for RC_CHANNELS_SCALED_DATA {
25805 type Message = MavMessage;
25806 const ID: u32 = 34u32;
25807 const NAME: &'static str = "RC_CHANNELS_SCALED";
25808 const EXTRA_CRC: u8 = 237u8;
25809 const ENCODED_LEN: usize = 22usize;
25810 fn deser(
25811 _version: MavlinkVersion,
25812 __input: &[u8],
25813 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25814 let avail_len = __input.len();
25815 let mut payload_buf = [0; Self::ENCODED_LEN];
25816 let mut buf = if avail_len < Self::ENCODED_LEN {
25817 payload_buf[0..avail_len].copy_from_slice(__input);
25818 Bytes::new(&payload_buf)
25819 } else {
25820 Bytes::new(__input)
25821 };
25822 let mut __struct = Self::default();
25823 __struct.time_boot_ms = buf.get_u32_le();
25824 __struct.chan1_scaled = buf.get_i16_le();
25825 __struct.chan2_scaled = buf.get_i16_le();
25826 __struct.chan3_scaled = buf.get_i16_le();
25827 __struct.chan4_scaled = buf.get_i16_le();
25828 __struct.chan5_scaled = buf.get_i16_le();
25829 __struct.chan6_scaled = buf.get_i16_le();
25830 __struct.chan7_scaled = buf.get_i16_le();
25831 __struct.chan8_scaled = buf.get_i16_le();
25832 __struct.port = buf.get_u8();
25833 __struct.rssi = buf.get_u8();
25834 Ok(__struct)
25835 }
25836 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25837 let mut __tmp = BytesMut::new(bytes);
25838 #[allow(clippy::absurd_extreme_comparisons)]
25839 #[allow(unused_comparisons)]
25840 if __tmp.remaining() < Self::ENCODED_LEN {
25841 panic!(
25842 "buffer is too small (need {} bytes, but got {})",
25843 Self::ENCODED_LEN,
25844 __tmp.remaining(),
25845 )
25846 }
25847 __tmp.put_u32_le(self.time_boot_ms);
25848 __tmp.put_i16_le(self.chan1_scaled);
25849 __tmp.put_i16_le(self.chan2_scaled);
25850 __tmp.put_i16_le(self.chan3_scaled);
25851 __tmp.put_i16_le(self.chan4_scaled);
25852 __tmp.put_i16_le(self.chan5_scaled);
25853 __tmp.put_i16_le(self.chan6_scaled);
25854 __tmp.put_i16_le(self.chan7_scaled);
25855 __tmp.put_i16_le(self.chan8_scaled);
25856 __tmp.put_u8(self.port);
25857 __tmp.put_u8(self.rssi);
25858 if matches!(version, MavlinkVersion::V2) {
25859 let len = __tmp.len();
25860 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25861 } else {
25862 __tmp.len()
25863 }
25864 }
25865}
25866#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
25867#[doc = "id: 66"]
25868#[doc = "Request a data stream."]
25869#[derive(Debug, Clone, PartialEq)]
25870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25872pub struct REQUEST_DATA_STREAM_DATA {
25873 #[doc = "The requested message rate"]
25874 pub req_message_rate: u16,
25875 #[doc = "The target requested to send the message stream."]
25876 pub target_system: u8,
25877 #[doc = "The target requested to send the message stream."]
25878 pub target_component: u8,
25879 #[doc = "The ID of the requested data stream"]
25880 pub req_stream_id: u8,
25881 #[doc = "1 to start sending, 0 to stop sending."]
25882 pub start_stop: u8,
25883}
25884impl REQUEST_DATA_STREAM_DATA {
25885 pub const ENCODED_LEN: usize = 6usize;
25886 pub const DEFAULT: Self = Self {
25887 req_message_rate: 0_u16,
25888 target_system: 0_u8,
25889 target_component: 0_u8,
25890 req_stream_id: 0_u8,
25891 start_stop: 0_u8,
25892 };
25893 #[cfg(feature = "arbitrary")]
25894 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25895 use arbitrary::{Arbitrary, Unstructured};
25896 let mut buf = [0u8; 1024];
25897 rng.fill_bytes(&mut buf);
25898 let mut unstructured = Unstructured::new(&buf);
25899 Self::arbitrary(&mut unstructured).unwrap_or_default()
25900 }
25901}
25902impl Default for REQUEST_DATA_STREAM_DATA {
25903 fn default() -> Self {
25904 Self::DEFAULT.clone()
25905 }
25906}
25907impl MessageData for REQUEST_DATA_STREAM_DATA {
25908 type Message = MavMessage;
25909 const ID: u32 = 66u32;
25910 const NAME: &'static str = "REQUEST_DATA_STREAM";
25911 const EXTRA_CRC: u8 = 148u8;
25912 const ENCODED_LEN: usize = 6usize;
25913 fn deser(
25914 _version: MavlinkVersion,
25915 __input: &[u8],
25916 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25917 let avail_len = __input.len();
25918 let mut payload_buf = [0; Self::ENCODED_LEN];
25919 let mut buf = if avail_len < Self::ENCODED_LEN {
25920 payload_buf[0..avail_len].copy_from_slice(__input);
25921 Bytes::new(&payload_buf)
25922 } else {
25923 Bytes::new(__input)
25924 };
25925 let mut __struct = Self::default();
25926 __struct.req_message_rate = buf.get_u16_le();
25927 __struct.target_system = buf.get_u8();
25928 __struct.target_component = buf.get_u8();
25929 __struct.req_stream_id = buf.get_u8();
25930 __struct.start_stop = buf.get_u8();
25931 Ok(__struct)
25932 }
25933 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25934 let mut __tmp = BytesMut::new(bytes);
25935 #[allow(clippy::absurd_extreme_comparisons)]
25936 #[allow(unused_comparisons)]
25937 if __tmp.remaining() < Self::ENCODED_LEN {
25938 panic!(
25939 "buffer is too small (need {} bytes, but got {})",
25940 Self::ENCODED_LEN,
25941 __tmp.remaining(),
25942 )
25943 }
25944 __tmp.put_u16_le(self.req_message_rate);
25945 __tmp.put_u8(self.target_system);
25946 __tmp.put_u8(self.target_component);
25947 __tmp.put_u8(self.req_stream_id);
25948 __tmp.put_u8(self.start_stop);
25949 if matches!(version, MavlinkVersion::V2) {
25950 let len = __tmp.len();
25951 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25952 } else {
25953 __tmp.len()
25954 }
25955 }
25956}
25957#[doc = "id: 412"]
25958#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
25959#[derive(Debug, Clone, PartialEq)]
25960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25962pub struct REQUEST_EVENT_DATA {
25963 #[doc = "First sequence number of the requested event."]
25964 pub first_sequence: u16,
25965 #[doc = "Last sequence number of the requested event."]
25966 pub last_sequence: u16,
25967 #[doc = "System ID"]
25968 pub target_system: u8,
25969 #[doc = "Component ID"]
25970 pub target_component: u8,
25971}
25972impl REQUEST_EVENT_DATA {
25973 pub const ENCODED_LEN: usize = 6usize;
25974 pub const DEFAULT: Self = Self {
25975 first_sequence: 0_u16,
25976 last_sequence: 0_u16,
25977 target_system: 0_u8,
25978 target_component: 0_u8,
25979 };
25980 #[cfg(feature = "arbitrary")]
25981 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25982 use arbitrary::{Arbitrary, Unstructured};
25983 let mut buf = [0u8; 1024];
25984 rng.fill_bytes(&mut buf);
25985 let mut unstructured = Unstructured::new(&buf);
25986 Self::arbitrary(&mut unstructured).unwrap_or_default()
25987 }
25988}
25989impl Default for REQUEST_EVENT_DATA {
25990 fn default() -> Self {
25991 Self::DEFAULT.clone()
25992 }
25993}
25994impl MessageData for REQUEST_EVENT_DATA {
25995 type Message = MavMessage;
25996 const ID: u32 = 412u32;
25997 const NAME: &'static str = "REQUEST_EVENT";
25998 const EXTRA_CRC: u8 = 33u8;
25999 const ENCODED_LEN: usize = 6usize;
26000 fn deser(
26001 _version: MavlinkVersion,
26002 __input: &[u8],
26003 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26004 let avail_len = __input.len();
26005 let mut payload_buf = [0; Self::ENCODED_LEN];
26006 let mut buf = if avail_len < Self::ENCODED_LEN {
26007 payload_buf[0..avail_len].copy_from_slice(__input);
26008 Bytes::new(&payload_buf)
26009 } else {
26010 Bytes::new(__input)
26011 };
26012 let mut __struct = Self::default();
26013 __struct.first_sequence = buf.get_u16_le();
26014 __struct.last_sequence = buf.get_u16_le();
26015 __struct.target_system = buf.get_u8();
26016 __struct.target_component = buf.get_u8();
26017 Ok(__struct)
26018 }
26019 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26020 let mut __tmp = BytesMut::new(bytes);
26021 #[allow(clippy::absurd_extreme_comparisons)]
26022 #[allow(unused_comparisons)]
26023 if __tmp.remaining() < Self::ENCODED_LEN {
26024 panic!(
26025 "buffer is too small (need {} bytes, but got {})",
26026 Self::ENCODED_LEN,
26027 __tmp.remaining(),
26028 )
26029 }
26030 __tmp.put_u16_le(self.first_sequence);
26031 __tmp.put_u16_le(self.last_sequence);
26032 __tmp.put_u8(self.target_system);
26033 __tmp.put_u8(self.target_component);
26034 if matches!(version, MavlinkVersion::V2) {
26035 let len = __tmp.len();
26036 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26037 } else {
26038 __tmp.len()
26039 }
26040 }
26041}
26042#[doc = "id: 142"]
26043#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26044#[derive(Debug, Clone, PartialEq)]
26045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26047pub struct RESOURCE_REQUEST_DATA {
26048 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26049 pub request_id: u8,
26050 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26051 pub uri_type: u8,
26052 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26053 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26054 pub uri: [u8; 120],
26055 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26056 pub transfer_type: u8,
26057 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26058 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26059 pub storage: [u8; 120],
26060}
26061impl RESOURCE_REQUEST_DATA {
26062 pub const ENCODED_LEN: usize = 243usize;
26063 pub const DEFAULT: Self = Self {
26064 request_id: 0_u8,
26065 uri_type: 0_u8,
26066 uri: [0_u8; 120usize],
26067 transfer_type: 0_u8,
26068 storage: [0_u8; 120usize],
26069 };
26070 #[cfg(feature = "arbitrary")]
26071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26072 use arbitrary::{Arbitrary, Unstructured};
26073 let mut buf = [0u8; 1024];
26074 rng.fill_bytes(&mut buf);
26075 let mut unstructured = Unstructured::new(&buf);
26076 Self::arbitrary(&mut unstructured).unwrap_or_default()
26077 }
26078}
26079impl Default for RESOURCE_REQUEST_DATA {
26080 fn default() -> Self {
26081 Self::DEFAULT.clone()
26082 }
26083}
26084impl MessageData for RESOURCE_REQUEST_DATA {
26085 type Message = MavMessage;
26086 const ID: u32 = 142u32;
26087 const NAME: &'static str = "RESOURCE_REQUEST";
26088 const EXTRA_CRC: u8 = 72u8;
26089 const ENCODED_LEN: usize = 243usize;
26090 fn deser(
26091 _version: MavlinkVersion,
26092 __input: &[u8],
26093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26094 let avail_len = __input.len();
26095 let mut payload_buf = [0; Self::ENCODED_LEN];
26096 let mut buf = if avail_len < Self::ENCODED_LEN {
26097 payload_buf[0..avail_len].copy_from_slice(__input);
26098 Bytes::new(&payload_buf)
26099 } else {
26100 Bytes::new(__input)
26101 };
26102 let mut __struct = Self::default();
26103 __struct.request_id = buf.get_u8();
26104 __struct.uri_type = buf.get_u8();
26105 for v in &mut __struct.uri {
26106 let val = buf.get_u8();
26107 *v = val;
26108 }
26109 __struct.transfer_type = buf.get_u8();
26110 for v in &mut __struct.storage {
26111 let val = buf.get_u8();
26112 *v = val;
26113 }
26114 Ok(__struct)
26115 }
26116 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26117 let mut __tmp = BytesMut::new(bytes);
26118 #[allow(clippy::absurd_extreme_comparisons)]
26119 #[allow(unused_comparisons)]
26120 if __tmp.remaining() < Self::ENCODED_LEN {
26121 panic!(
26122 "buffer is too small (need {} bytes, but got {})",
26123 Self::ENCODED_LEN,
26124 __tmp.remaining(),
26125 )
26126 }
26127 __tmp.put_u8(self.request_id);
26128 __tmp.put_u8(self.uri_type);
26129 for val in &self.uri {
26130 __tmp.put_u8(*val);
26131 }
26132 __tmp.put_u8(self.transfer_type);
26133 for val in &self.storage {
26134 __tmp.put_u8(*val);
26135 }
26136 if matches!(version, MavlinkVersion::V2) {
26137 let len = __tmp.len();
26138 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26139 } else {
26140 __tmp.len()
26141 }
26142 }
26143}
26144#[doc = "id: 413"]
26145#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26146#[derive(Debug, Clone, PartialEq)]
26147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26148#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26149pub struct RESPONSE_EVENT_ERROR_DATA {
26150 #[doc = "Sequence number."]
26151 pub sequence: u16,
26152 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26153 pub sequence_oldest_available: u16,
26154 #[doc = "System ID"]
26155 pub target_system: u8,
26156 #[doc = "Component ID"]
26157 pub target_component: u8,
26158 #[doc = "Error reason."]
26159 pub reason: MavEventErrorReason,
26160}
26161impl RESPONSE_EVENT_ERROR_DATA {
26162 pub const ENCODED_LEN: usize = 7usize;
26163 pub const DEFAULT: Self = Self {
26164 sequence: 0_u16,
26165 sequence_oldest_available: 0_u16,
26166 target_system: 0_u8,
26167 target_component: 0_u8,
26168 reason: MavEventErrorReason::DEFAULT,
26169 };
26170 #[cfg(feature = "arbitrary")]
26171 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26172 use arbitrary::{Arbitrary, Unstructured};
26173 let mut buf = [0u8; 1024];
26174 rng.fill_bytes(&mut buf);
26175 let mut unstructured = Unstructured::new(&buf);
26176 Self::arbitrary(&mut unstructured).unwrap_or_default()
26177 }
26178}
26179impl Default for RESPONSE_EVENT_ERROR_DATA {
26180 fn default() -> Self {
26181 Self::DEFAULT.clone()
26182 }
26183}
26184impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26185 type Message = MavMessage;
26186 const ID: u32 = 413u32;
26187 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26188 const EXTRA_CRC: u8 = 77u8;
26189 const ENCODED_LEN: usize = 7usize;
26190 fn deser(
26191 _version: MavlinkVersion,
26192 __input: &[u8],
26193 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26194 let avail_len = __input.len();
26195 let mut payload_buf = [0; Self::ENCODED_LEN];
26196 let mut buf = if avail_len < Self::ENCODED_LEN {
26197 payload_buf[0..avail_len].copy_from_slice(__input);
26198 Bytes::new(&payload_buf)
26199 } else {
26200 Bytes::new(__input)
26201 };
26202 let mut __struct = Self::default();
26203 __struct.sequence = buf.get_u16_le();
26204 __struct.sequence_oldest_available = buf.get_u16_le();
26205 __struct.target_system = buf.get_u8();
26206 __struct.target_component = buf.get_u8();
26207 let tmp = buf.get_u8();
26208 __struct.reason =
26209 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26210 enum_type: "MavEventErrorReason",
26211 value: tmp as u32,
26212 })?;
26213 Ok(__struct)
26214 }
26215 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26216 let mut __tmp = BytesMut::new(bytes);
26217 #[allow(clippy::absurd_extreme_comparisons)]
26218 #[allow(unused_comparisons)]
26219 if __tmp.remaining() < Self::ENCODED_LEN {
26220 panic!(
26221 "buffer is too small (need {} bytes, but got {})",
26222 Self::ENCODED_LEN,
26223 __tmp.remaining(),
26224 )
26225 }
26226 __tmp.put_u16_le(self.sequence);
26227 __tmp.put_u16_le(self.sequence_oldest_available);
26228 __tmp.put_u8(self.target_system);
26229 __tmp.put_u8(self.target_component);
26230 __tmp.put_u8(self.reason as u8);
26231 if matches!(version, MavlinkVersion::V2) {
26232 let len = __tmp.len();
26233 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26234 } else {
26235 __tmp.len()
26236 }
26237 }
26238}
26239#[doc = "id: 55"]
26240#[doc = "Read out the safety zone the MAV currently assumes."]
26241#[derive(Debug, Clone, PartialEq)]
26242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26244pub struct SAFETY_ALLOWED_AREA_DATA {
26245 #[doc = "x position 1 / Latitude 1"]
26246 pub p1x: f32,
26247 #[doc = "y position 1 / Longitude 1"]
26248 pub p1y: f32,
26249 #[doc = "z position 1 / Altitude 1"]
26250 pub p1z: f32,
26251 #[doc = "x position 2 / Latitude 2"]
26252 pub p2x: f32,
26253 #[doc = "y position 2 / Longitude 2"]
26254 pub p2y: f32,
26255 #[doc = "z position 2 / Altitude 2"]
26256 pub p2z: f32,
26257 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26258 pub frame: MavFrame,
26259}
26260impl SAFETY_ALLOWED_AREA_DATA {
26261 pub const ENCODED_LEN: usize = 25usize;
26262 pub const DEFAULT: Self = Self {
26263 p1x: 0.0_f32,
26264 p1y: 0.0_f32,
26265 p1z: 0.0_f32,
26266 p2x: 0.0_f32,
26267 p2y: 0.0_f32,
26268 p2z: 0.0_f32,
26269 frame: MavFrame::DEFAULT,
26270 };
26271 #[cfg(feature = "arbitrary")]
26272 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26273 use arbitrary::{Arbitrary, Unstructured};
26274 let mut buf = [0u8; 1024];
26275 rng.fill_bytes(&mut buf);
26276 let mut unstructured = Unstructured::new(&buf);
26277 Self::arbitrary(&mut unstructured).unwrap_or_default()
26278 }
26279}
26280impl Default for SAFETY_ALLOWED_AREA_DATA {
26281 fn default() -> Self {
26282 Self::DEFAULT.clone()
26283 }
26284}
26285impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26286 type Message = MavMessage;
26287 const ID: u32 = 55u32;
26288 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26289 const EXTRA_CRC: u8 = 3u8;
26290 const ENCODED_LEN: usize = 25usize;
26291 fn deser(
26292 _version: MavlinkVersion,
26293 __input: &[u8],
26294 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26295 let avail_len = __input.len();
26296 let mut payload_buf = [0; Self::ENCODED_LEN];
26297 let mut buf = if avail_len < Self::ENCODED_LEN {
26298 payload_buf[0..avail_len].copy_from_slice(__input);
26299 Bytes::new(&payload_buf)
26300 } else {
26301 Bytes::new(__input)
26302 };
26303 let mut __struct = Self::default();
26304 __struct.p1x = buf.get_f32_le();
26305 __struct.p1y = buf.get_f32_le();
26306 __struct.p1z = buf.get_f32_le();
26307 __struct.p2x = buf.get_f32_le();
26308 __struct.p2y = buf.get_f32_le();
26309 __struct.p2z = buf.get_f32_le();
26310 let tmp = buf.get_u8();
26311 __struct.frame =
26312 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26313 enum_type: "MavFrame",
26314 value: tmp as u32,
26315 })?;
26316 Ok(__struct)
26317 }
26318 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26319 let mut __tmp = BytesMut::new(bytes);
26320 #[allow(clippy::absurd_extreme_comparisons)]
26321 #[allow(unused_comparisons)]
26322 if __tmp.remaining() < Self::ENCODED_LEN {
26323 panic!(
26324 "buffer is too small (need {} bytes, but got {})",
26325 Self::ENCODED_LEN,
26326 __tmp.remaining(),
26327 )
26328 }
26329 __tmp.put_f32_le(self.p1x);
26330 __tmp.put_f32_le(self.p1y);
26331 __tmp.put_f32_le(self.p1z);
26332 __tmp.put_f32_le(self.p2x);
26333 __tmp.put_f32_le(self.p2y);
26334 __tmp.put_f32_le(self.p2z);
26335 __tmp.put_u8(self.frame as u8);
26336 if matches!(version, MavlinkVersion::V2) {
26337 let len = __tmp.len();
26338 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26339 } else {
26340 __tmp.len()
26341 }
26342 }
26343}
26344#[doc = "id: 54"]
26345#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26346#[derive(Debug, Clone, PartialEq)]
26347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26348#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26349pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26350 #[doc = "x position 1 / Latitude 1"]
26351 pub p1x: f32,
26352 #[doc = "y position 1 / Longitude 1"]
26353 pub p1y: f32,
26354 #[doc = "z position 1 / Altitude 1"]
26355 pub p1z: f32,
26356 #[doc = "x position 2 / Latitude 2"]
26357 pub p2x: f32,
26358 #[doc = "y position 2 / Longitude 2"]
26359 pub p2y: f32,
26360 #[doc = "z position 2 / Altitude 2"]
26361 pub p2z: f32,
26362 #[doc = "System ID"]
26363 pub target_system: u8,
26364 #[doc = "Component ID"]
26365 pub target_component: u8,
26366 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26367 pub frame: MavFrame,
26368}
26369impl SAFETY_SET_ALLOWED_AREA_DATA {
26370 pub const ENCODED_LEN: usize = 27usize;
26371 pub const DEFAULT: Self = Self {
26372 p1x: 0.0_f32,
26373 p1y: 0.0_f32,
26374 p1z: 0.0_f32,
26375 p2x: 0.0_f32,
26376 p2y: 0.0_f32,
26377 p2z: 0.0_f32,
26378 target_system: 0_u8,
26379 target_component: 0_u8,
26380 frame: MavFrame::DEFAULT,
26381 };
26382 #[cfg(feature = "arbitrary")]
26383 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26384 use arbitrary::{Arbitrary, Unstructured};
26385 let mut buf = [0u8; 1024];
26386 rng.fill_bytes(&mut buf);
26387 let mut unstructured = Unstructured::new(&buf);
26388 Self::arbitrary(&mut unstructured).unwrap_or_default()
26389 }
26390}
26391impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26392 fn default() -> Self {
26393 Self::DEFAULT.clone()
26394 }
26395}
26396impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26397 type Message = MavMessage;
26398 const ID: u32 = 54u32;
26399 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26400 const EXTRA_CRC: u8 = 15u8;
26401 const ENCODED_LEN: usize = 27usize;
26402 fn deser(
26403 _version: MavlinkVersion,
26404 __input: &[u8],
26405 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26406 let avail_len = __input.len();
26407 let mut payload_buf = [0; Self::ENCODED_LEN];
26408 let mut buf = if avail_len < Self::ENCODED_LEN {
26409 payload_buf[0..avail_len].copy_from_slice(__input);
26410 Bytes::new(&payload_buf)
26411 } else {
26412 Bytes::new(__input)
26413 };
26414 let mut __struct = Self::default();
26415 __struct.p1x = buf.get_f32_le();
26416 __struct.p1y = buf.get_f32_le();
26417 __struct.p1z = buf.get_f32_le();
26418 __struct.p2x = buf.get_f32_le();
26419 __struct.p2y = buf.get_f32_le();
26420 __struct.p2z = buf.get_f32_le();
26421 __struct.target_system = buf.get_u8();
26422 __struct.target_component = buf.get_u8();
26423 let tmp = buf.get_u8();
26424 __struct.frame =
26425 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26426 enum_type: "MavFrame",
26427 value: tmp as u32,
26428 })?;
26429 Ok(__struct)
26430 }
26431 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26432 let mut __tmp = BytesMut::new(bytes);
26433 #[allow(clippy::absurd_extreme_comparisons)]
26434 #[allow(unused_comparisons)]
26435 if __tmp.remaining() < Self::ENCODED_LEN {
26436 panic!(
26437 "buffer is too small (need {} bytes, but got {})",
26438 Self::ENCODED_LEN,
26439 __tmp.remaining(),
26440 )
26441 }
26442 __tmp.put_f32_le(self.p1x);
26443 __tmp.put_f32_le(self.p1y);
26444 __tmp.put_f32_le(self.p1z);
26445 __tmp.put_f32_le(self.p2x);
26446 __tmp.put_f32_le(self.p2y);
26447 __tmp.put_f32_le(self.p2z);
26448 __tmp.put_u8(self.target_system);
26449 __tmp.put_u8(self.target_component);
26450 __tmp.put_u8(self.frame as u8);
26451 if matches!(version, MavlinkVersion::V2) {
26452 let len = __tmp.len();
26453 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26454 } else {
26455 __tmp.len()
26456 }
26457 }
26458}
26459#[doc = "id: 26"]
26460#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26461#[derive(Debug, Clone, PartialEq)]
26462#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26463#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26464pub struct SCALED_IMU_DATA {
26465 #[doc = "Timestamp (time since system boot)."]
26466 pub time_boot_ms: u32,
26467 #[doc = "X acceleration"]
26468 pub xacc: i16,
26469 #[doc = "Y acceleration"]
26470 pub yacc: i16,
26471 #[doc = "Z acceleration"]
26472 pub zacc: i16,
26473 #[doc = "Angular speed around X axis"]
26474 pub xgyro: i16,
26475 #[doc = "Angular speed around Y axis"]
26476 pub ygyro: i16,
26477 #[doc = "Angular speed around Z axis"]
26478 pub zgyro: i16,
26479 #[doc = "X Magnetic field"]
26480 pub xmag: i16,
26481 #[doc = "Y Magnetic field"]
26482 pub ymag: i16,
26483 #[doc = "Z Magnetic field"]
26484 pub zmag: i16,
26485 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26486 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26487 pub temperature: i16,
26488}
26489impl SCALED_IMU_DATA {
26490 pub const ENCODED_LEN: usize = 24usize;
26491 pub const DEFAULT: Self = Self {
26492 time_boot_ms: 0_u32,
26493 xacc: 0_i16,
26494 yacc: 0_i16,
26495 zacc: 0_i16,
26496 xgyro: 0_i16,
26497 ygyro: 0_i16,
26498 zgyro: 0_i16,
26499 xmag: 0_i16,
26500 ymag: 0_i16,
26501 zmag: 0_i16,
26502 temperature: 0_i16,
26503 };
26504 #[cfg(feature = "arbitrary")]
26505 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26506 use arbitrary::{Arbitrary, Unstructured};
26507 let mut buf = [0u8; 1024];
26508 rng.fill_bytes(&mut buf);
26509 let mut unstructured = Unstructured::new(&buf);
26510 Self::arbitrary(&mut unstructured).unwrap_or_default()
26511 }
26512}
26513impl Default for SCALED_IMU_DATA {
26514 fn default() -> Self {
26515 Self::DEFAULT.clone()
26516 }
26517}
26518impl MessageData for SCALED_IMU_DATA {
26519 type Message = MavMessage;
26520 const ID: u32 = 26u32;
26521 const NAME: &'static str = "SCALED_IMU";
26522 const EXTRA_CRC: u8 = 170u8;
26523 const ENCODED_LEN: usize = 24usize;
26524 fn deser(
26525 _version: MavlinkVersion,
26526 __input: &[u8],
26527 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26528 let avail_len = __input.len();
26529 let mut payload_buf = [0; Self::ENCODED_LEN];
26530 let mut buf = if avail_len < Self::ENCODED_LEN {
26531 payload_buf[0..avail_len].copy_from_slice(__input);
26532 Bytes::new(&payload_buf)
26533 } else {
26534 Bytes::new(__input)
26535 };
26536 let mut __struct = Self::default();
26537 __struct.time_boot_ms = buf.get_u32_le();
26538 __struct.xacc = buf.get_i16_le();
26539 __struct.yacc = buf.get_i16_le();
26540 __struct.zacc = buf.get_i16_le();
26541 __struct.xgyro = buf.get_i16_le();
26542 __struct.ygyro = buf.get_i16_le();
26543 __struct.zgyro = buf.get_i16_le();
26544 __struct.xmag = buf.get_i16_le();
26545 __struct.ymag = buf.get_i16_le();
26546 __struct.zmag = buf.get_i16_le();
26547 __struct.temperature = buf.get_i16_le();
26548 Ok(__struct)
26549 }
26550 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26551 let mut __tmp = BytesMut::new(bytes);
26552 #[allow(clippy::absurd_extreme_comparisons)]
26553 #[allow(unused_comparisons)]
26554 if __tmp.remaining() < Self::ENCODED_LEN {
26555 panic!(
26556 "buffer is too small (need {} bytes, but got {})",
26557 Self::ENCODED_LEN,
26558 __tmp.remaining(),
26559 )
26560 }
26561 __tmp.put_u32_le(self.time_boot_ms);
26562 __tmp.put_i16_le(self.xacc);
26563 __tmp.put_i16_le(self.yacc);
26564 __tmp.put_i16_le(self.zacc);
26565 __tmp.put_i16_le(self.xgyro);
26566 __tmp.put_i16_le(self.ygyro);
26567 __tmp.put_i16_le(self.zgyro);
26568 __tmp.put_i16_le(self.xmag);
26569 __tmp.put_i16_le(self.ymag);
26570 __tmp.put_i16_le(self.zmag);
26571 __tmp.put_i16_le(self.temperature);
26572 if matches!(version, MavlinkVersion::V2) {
26573 let len = __tmp.len();
26574 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26575 } else {
26576 __tmp.len()
26577 }
26578 }
26579}
26580#[doc = "id: 116"]
26581#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26582#[derive(Debug, Clone, PartialEq)]
26583#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26585pub struct SCALED_IMU2_DATA {
26586 #[doc = "Timestamp (time since system boot)."]
26587 pub time_boot_ms: u32,
26588 #[doc = "X acceleration"]
26589 pub xacc: i16,
26590 #[doc = "Y acceleration"]
26591 pub yacc: i16,
26592 #[doc = "Z acceleration"]
26593 pub zacc: i16,
26594 #[doc = "Angular speed around X axis"]
26595 pub xgyro: i16,
26596 #[doc = "Angular speed around Y axis"]
26597 pub ygyro: i16,
26598 #[doc = "Angular speed around Z axis"]
26599 pub zgyro: i16,
26600 #[doc = "X Magnetic field"]
26601 pub xmag: i16,
26602 #[doc = "Y Magnetic field"]
26603 pub ymag: i16,
26604 #[doc = "Z Magnetic field"]
26605 pub zmag: i16,
26606 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26607 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26608 pub temperature: i16,
26609}
26610impl SCALED_IMU2_DATA {
26611 pub const ENCODED_LEN: usize = 24usize;
26612 pub const DEFAULT: Self = Self {
26613 time_boot_ms: 0_u32,
26614 xacc: 0_i16,
26615 yacc: 0_i16,
26616 zacc: 0_i16,
26617 xgyro: 0_i16,
26618 ygyro: 0_i16,
26619 zgyro: 0_i16,
26620 xmag: 0_i16,
26621 ymag: 0_i16,
26622 zmag: 0_i16,
26623 temperature: 0_i16,
26624 };
26625 #[cfg(feature = "arbitrary")]
26626 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26627 use arbitrary::{Arbitrary, Unstructured};
26628 let mut buf = [0u8; 1024];
26629 rng.fill_bytes(&mut buf);
26630 let mut unstructured = Unstructured::new(&buf);
26631 Self::arbitrary(&mut unstructured).unwrap_or_default()
26632 }
26633}
26634impl Default for SCALED_IMU2_DATA {
26635 fn default() -> Self {
26636 Self::DEFAULT.clone()
26637 }
26638}
26639impl MessageData for SCALED_IMU2_DATA {
26640 type Message = MavMessage;
26641 const ID: u32 = 116u32;
26642 const NAME: &'static str = "SCALED_IMU2";
26643 const EXTRA_CRC: u8 = 76u8;
26644 const ENCODED_LEN: usize = 24usize;
26645 fn deser(
26646 _version: MavlinkVersion,
26647 __input: &[u8],
26648 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26649 let avail_len = __input.len();
26650 let mut payload_buf = [0; Self::ENCODED_LEN];
26651 let mut buf = if avail_len < Self::ENCODED_LEN {
26652 payload_buf[0..avail_len].copy_from_slice(__input);
26653 Bytes::new(&payload_buf)
26654 } else {
26655 Bytes::new(__input)
26656 };
26657 let mut __struct = Self::default();
26658 __struct.time_boot_ms = buf.get_u32_le();
26659 __struct.xacc = buf.get_i16_le();
26660 __struct.yacc = buf.get_i16_le();
26661 __struct.zacc = buf.get_i16_le();
26662 __struct.xgyro = buf.get_i16_le();
26663 __struct.ygyro = buf.get_i16_le();
26664 __struct.zgyro = buf.get_i16_le();
26665 __struct.xmag = buf.get_i16_le();
26666 __struct.ymag = buf.get_i16_le();
26667 __struct.zmag = buf.get_i16_le();
26668 __struct.temperature = buf.get_i16_le();
26669 Ok(__struct)
26670 }
26671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26672 let mut __tmp = BytesMut::new(bytes);
26673 #[allow(clippy::absurd_extreme_comparisons)]
26674 #[allow(unused_comparisons)]
26675 if __tmp.remaining() < Self::ENCODED_LEN {
26676 panic!(
26677 "buffer is too small (need {} bytes, but got {})",
26678 Self::ENCODED_LEN,
26679 __tmp.remaining(),
26680 )
26681 }
26682 __tmp.put_u32_le(self.time_boot_ms);
26683 __tmp.put_i16_le(self.xacc);
26684 __tmp.put_i16_le(self.yacc);
26685 __tmp.put_i16_le(self.zacc);
26686 __tmp.put_i16_le(self.xgyro);
26687 __tmp.put_i16_le(self.ygyro);
26688 __tmp.put_i16_le(self.zgyro);
26689 __tmp.put_i16_le(self.xmag);
26690 __tmp.put_i16_le(self.ymag);
26691 __tmp.put_i16_le(self.zmag);
26692 __tmp.put_i16_le(self.temperature);
26693 if matches!(version, MavlinkVersion::V2) {
26694 let len = __tmp.len();
26695 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26696 } else {
26697 __tmp.len()
26698 }
26699 }
26700}
26701#[doc = "id: 129"]
26702#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
26703#[derive(Debug, Clone, PartialEq)]
26704#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26705#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26706pub struct SCALED_IMU3_DATA {
26707 #[doc = "Timestamp (time since system boot)."]
26708 pub time_boot_ms: u32,
26709 #[doc = "X acceleration"]
26710 pub xacc: i16,
26711 #[doc = "Y acceleration"]
26712 pub yacc: i16,
26713 #[doc = "Z acceleration"]
26714 pub zacc: i16,
26715 #[doc = "Angular speed around X axis"]
26716 pub xgyro: i16,
26717 #[doc = "Angular speed around Y axis"]
26718 pub ygyro: i16,
26719 #[doc = "Angular speed around Z axis"]
26720 pub zgyro: i16,
26721 #[doc = "X Magnetic field"]
26722 pub xmag: i16,
26723 #[doc = "Y Magnetic field"]
26724 pub ymag: i16,
26725 #[doc = "Z Magnetic field"]
26726 pub zmag: i16,
26727 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26728 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26729 pub temperature: i16,
26730}
26731impl SCALED_IMU3_DATA {
26732 pub const ENCODED_LEN: usize = 24usize;
26733 pub const DEFAULT: Self = Self {
26734 time_boot_ms: 0_u32,
26735 xacc: 0_i16,
26736 yacc: 0_i16,
26737 zacc: 0_i16,
26738 xgyro: 0_i16,
26739 ygyro: 0_i16,
26740 zgyro: 0_i16,
26741 xmag: 0_i16,
26742 ymag: 0_i16,
26743 zmag: 0_i16,
26744 temperature: 0_i16,
26745 };
26746 #[cfg(feature = "arbitrary")]
26747 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26748 use arbitrary::{Arbitrary, Unstructured};
26749 let mut buf = [0u8; 1024];
26750 rng.fill_bytes(&mut buf);
26751 let mut unstructured = Unstructured::new(&buf);
26752 Self::arbitrary(&mut unstructured).unwrap_or_default()
26753 }
26754}
26755impl Default for SCALED_IMU3_DATA {
26756 fn default() -> Self {
26757 Self::DEFAULT.clone()
26758 }
26759}
26760impl MessageData for SCALED_IMU3_DATA {
26761 type Message = MavMessage;
26762 const ID: u32 = 129u32;
26763 const NAME: &'static str = "SCALED_IMU3";
26764 const EXTRA_CRC: u8 = 46u8;
26765 const ENCODED_LEN: usize = 24usize;
26766 fn deser(
26767 _version: MavlinkVersion,
26768 __input: &[u8],
26769 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26770 let avail_len = __input.len();
26771 let mut payload_buf = [0; Self::ENCODED_LEN];
26772 let mut buf = if avail_len < Self::ENCODED_LEN {
26773 payload_buf[0..avail_len].copy_from_slice(__input);
26774 Bytes::new(&payload_buf)
26775 } else {
26776 Bytes::new(__input)
26777 };
26778 let mut __struct = Self::default();
26779 __struct.time_boot_ms = buf.get_u32_le();
26780 __struct.xacc = buf.get_i16_le();
26781 __struct.yacc = buf.get_i16_le();
26782 __struct.zacc = buf.get_i16_le();
26783 __struct.xgyro = buf.get_i16_le();
26784 __struct.ygyro = buf.get_i16_le();
26785 __struct.zgyro = buf.get_i16_le();
26786 __struct.xmag = buf.get_i16_le();
26787 __struct.ymag = buf.get_i16_le();
26788 __struct.zmag = buf.get_i16_le();
26789 __struct.temperature = buf.get_i16_le();
26790 Ok(__struct)
26791 }
26792 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26793 let mut __tmp = BytesMut::new(bytes);
26794 #[allow(clippy::absurd_extreme_comparisons)]
26795 #[allow(unused_comparisons)]
26796 if __tmp.remaining() < Self::ENCODED_LEN {
26797 panic!(
26798 "buffer is too small (need {} bytes, but got {})",
26799 Self::ENCODED_LEN,
26800 __tmp.remaining(),
26801 )
26802 }
26803 __tmp.put_u32_le(self.time_boot_ms);
26804 __tmp.put_i16_le(self.xacc);
26805 __tmp.put_i16_le(self.yacc);
26806 __tmp.put_i16_le(self.zacc);
26807 __tmp.put_i16_le(self.xgyro);
26808 __tmp.put_i16_le(self.ygyro);
26809 __tmp.put_i16_le(self.zgyro);
26810 __tmp.put_i16_le(self.xmag);
26811 __tmp.put_i16_le(self.ymag);
26812 __tmp.put_i16_le(self.zmag);
26813 __tmp.put_i16_le(self.temperature);
26814 if matches!(version, MavlinkVersion::V2) {
26815 let len = __tmp.len();
26816 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26817 } else {
26818 __tmp.len()
26819 }
26820 }
26821}
26822#[doc = "id: 29"]
26823#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
26824#[derive(Debug, Clone, PartialEq)]
26825#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26826#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26827pub struct SCALED_PRESSURE_DATA {
26828 #[doc = "Timestamp (time since system boot)."]
26829 pub time_boot_ms: u32,
26830 #[doc = "Absolute pressure"]
26831 pub press_abs: f32,
26832 #[doc = "Differential pressure 1"]
26833 pub press_diff: f32,
26834 #[doc = "Absolute pressure temperature"]
26835 pub temperature: i16,
26836 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26837 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26838 pub temperature_press_diff: i16,
26839}
26840impl SCALED_PRESSURE_DATA {
26841 pub const ENCODED_LEN: usize = 16usize;
26842 pub const DEFAULT: Self = Self {
26843 time_boot_ms: 0_u32,
26844 press_abs: 0.0_f32,
26845 press_diff: 0.0_f32,
26846 temperature: 0_i16,
26847 temperature_press_diff: 0_i16,
26848 };
26849 #[cfg(feature = "arbitrary")]
26850 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26851 use arbitrary::{Arbitrary, Unstructured};
26852 let mut buf = [0u8; 1024];
26853 rng.fill_bytes(&mut buf);
26854 let mut unstructured = Unstructured::new(&buf);
26855 Self::arbitrary(&mut unstructured).unwrap_or_default()
26856 }
26857}
26858impl Default for SCALED_PRESSURE_DATA {
26859 fn default() -> Self {
26860 Self::DEFAULT.clone()
26861 }
26862}
26863impl MessageData for SCALED_PRESSURE_DATA {
26864 type Message = MavMessage;
26865 const ID: u32 = 29u32;
26866 const NAME: &'static str = "SCALED_PRESSURE";
26867 const EXTRA_CRC: u8 = 115u8;
26868 const ENCODED_LEN: usize = 16usize;
26869 fn deser(
26870 _version: MavlinkVersion,
26871 __input: &[u8],
26872 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26873 let avail_len = __input.len();
26874 let mut payload_buf = [0; Self::ENCODED_LEN];
26875 let mut buf = if avail_len < Self::ENCODED_LEN {
26876 payload_buf[0..avail_len].copy_from_slice(__input);
26877 Bytes::new(&payload_buf)
26878 } else {
26879 Bytes::new(__input)
26880 };
26881 let mut __struct = Self::default();
26882 __struct.time_boot_ms = buf.get_u32_le();
26883 __struct.press_abs = buf.get_f32_le();
26884 __struct.press_diff = buf.get_f32_le();
26885 __struct.temperature = buf.get_i16_le();
26886 __struct.temperature_press_diff = buf.get_i16_le();
26887 Ok(__struct)
26888 }
26889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26890 let mut __tmp = BytesMut::new(bytes);
26891 #[allow(clippy::absurd_extreme_comparisons)]
26892 #[allow(unused_comparisons)]
26893 if __tmp.remaining() < Self::ENCODED_LEN {
26894 panic!(
26895 "buffer is too small (need {} bytes, but got {})",
26896 Self::ENCODED_LEN,
26897 __tmp.remaining(),
26898 )
26899 }
26900 __tmp.put_u32_le(self.time_boot_ms);
26901 __tmp.put_f32_le(self.press_abs);
26902 __tmp.put_f32_le(self.press_diff);
26903 __tmp.put_i16_le(self.temperature);
26904 __tmp.put_i16_le(self.temperature_press_diff);
26905 if matches!(version, MavlinkVersion::V2) {
26906 let len = __tmp.len();
26907 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26908 } else {
26909 __tmp.len()
26910 }
26911 }
26912}
26913#[doc = "id: 137"]
26914#[doc = "Barometer readings for 2nd barometer."]
26915#[derive(Debug, Clone, PartialEq)]
26916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26918pub struct SCALED_PRESSURE2_DATA {
26919 #[doc = "Timestamp (time since system boot)."]
26920 pub time_boot_ms: u32,
26921 #[doc = "Absolute pressure"]
26922 pub press_abs: f32,
26923 #[doc = "Differential pressure"]
26924 pub press_diff: f32,
26925 #[doc = "Absolute pressure temperature"]
26926 pub temperature: i16,
26927 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26928 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26929 pub temperature_press_diff: i16,
26930}
26931impl SCALED_PRESSURE2_DATA {
26932 pub const ENCODED_LEN: usize = 16usize;
26933 pub const DEFAULT: Self = Self {
26934 time_boot_ms: 0_u32,
26935 press_abs: 0.0_f32,
26936 press_diff: 0.0_f32,
26937 temperature: 0_i16,
26938 temperature_press_diff: 0_i16,
26939 };
26940 #[cfg(feature = "arbitrary")]
26941 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26942 use arbitrary::{Arbitrary, Unstructured};
26943 let mut buf = [0u8; 1024];
26944 rng.fill_bytes(&mut buf);
26945 let mut unstructured = Unstructured::new(&buf);
26946 Self::arbitrary(&mut unstructured).unwrap_or_default()
26947 }
26948}
26949impl Default for SCALED_PRESSURE2_DATA {
26950 fn default() -> Self {
26951 Self::DEFAULT.clone()
26952 }
26953}
26954impl MessageData for SCALED_PRESSURE2_DATA {
26955 type Message = MavMessage;
26956 const ID: u32 = 137u32;
26957 const NAME: &'static str = "SCALED_PRESSURE2";
26958 const EXTRA_CRC: u8 = 195u8;
26959 const ENCODED_LEN: usize = 16usize;
26960 fn deser(
26961 _version: MavlinkVersion,
26962 __input: &[u8],
26963 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26964 let avail_len = __input.len();
26965 let mut payload_buf = [0; Self::ENCODED_LEN];
26966 let mut buf = if avail_len < Self::ENCODED_LEN {
26967 payload_buf[0..avail_len].copy_from_slice(__input);
26968 Bytes::new(&payload_buf)
26969 } else {
26970 Bytes::new(__input)
26971 };
26972 let mut __struct = Self::default();
26973 __struct.time_boot_ms = buf.get_u32_le();
26974 __struct.press_abs = buf.get_f32_le();
26975 __struct.press_diff = buf.get_f32_le();
26976 __struct.temperature = buf.get_i16_le();
26977 __struct.temperature_press_diff = buf.get_i16_le();
26978 Ok(__struct)
26979 }
26980 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26981 let mut __tmp = BytesMut::new(bytes);
26982 #[allow(clippy::absurd_extreme_comparisons)]
26983 #[allow(unused_comparisons)]
26984 if __tmp.remaining() < Self::ENCODED_LEN {
26985 panic!(
26986 "buffer is too small (need {} bytes, but got {})",
26987 Self::ENCODED_LEN,
26988 __tmp.remaining(),
26989 )
26990 }
26991 __tmp.put_u32_le(self.time_boot_ms);
26992 __tmp.put_f32_le(self.press_abs);
26993 __tmp.put_f32_le(self.press_diff);
26994 __tmp.put_i16_le(self.temperature);
26995 __tmp.put_i16_le(self.temperature_press_diff);
26996 if matches!(version, MavlinkVersion::V2) {
26997 let len = __tmp.len();
26998 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26999 } else {
27000 __tmp.len()
27001 }
27002 }
27003}
27004#[doc = "id: 143"]
27005#[doc = "Barometer readings for 3rd barometer."]
27006#[derive(Debug, Clone, PartialEq)]
27007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27008#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27009pub struct SCALED_PRESSURE3_DATA {
27010 #[doc = "Timestamp (time since system boot)."]
27011 pub time_boot_ms: u32,
27012 #[doc = "Absolute pressure"]
27013 pub press_abs: f32,
27014 #[doc = "Differential pressure"]
27015 pub press_diff: f32,
27016 #[doc = "Absolute pressure temperature"]
27017 pub temperature: i16,
27018 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27019 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27020 pub temperature_press_diff: i16,
27021}
27022impl SCALED_PRESSURE3_DATA {
27023 pub const ENCODED_LEN: usize = 16usize;
27024 pub const DEFAULT: Self = Self {
27025 time_boot_ms: 0_u32,
27026 press_abs: 0.0_f32,
27027 press_diff: 0.0_f32,
27028 temperature: 0_i16,
27029 temperature_press_diff: 0_i16,
27030 };
27031 #[cfg(feature = "arbitrary")]
27032 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27033 use arbitrary::{Arbitrary, Unstructured};
27034 let mut buf = [0u8; 1024];
27035 rng.fill_bytes(&mut buf);
27036 let mut unstructured = Unstructured::new(&buf);
27037 Self::arbitrary(&mut unstructured).unwrap_or_default()
27038 }
27039}
27040impl Default for SCALED_PRESSURE3_DATA {
27041 fn default() -> Self {
27042 Self::DEFAULT.clone()
27043 }
27044}
27045impl MessageData for SCALED_PRESSURE3_DATA {
27046 type Message = MavMessage;
27047 const ID: u32 = 143u32;
27048 const NAME: &'static str = "SCALED_PRESSURE3";
27049 const EXTRA_CRC: u8 = 131u8;
27050 const ENCODED_LEN: usize = 16usize;
27051 fn deser(
27052 _version: MavlinkVersion,
27053 __input: &[u8],
27054 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27055 let avail_len = __input.len();
27056 let mut payload_buf = [0; Self::ENCODED_LEN];
27057 let mut buf = if avail_len < Self::ENCODED_LEN {
27058 payload_buf[0..avail_len].copy_from_slice(__input);
27059 Bytes::new(&payload_buf)
27060 } else {
27061 Bytes::new(__input)
27062 };
27063 let mut __struct = Self::default();
27064 __struct.time_boot_ms = buf.get_u32_le();
27065 __struct.press_abs = buf.get_f32_le();
27066 __struct.press_diff = buf.get_f32_le();
27067 __struct.temperature = buf.get_i16_le();
27068 __struct.temperature_press_diff = buf.get_i16_le();
27069 Ok(__struct)
27070 }
27071 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27072 let mut __tmp = BytesMut::new(bytes);
27073 #[allow(clippy::absurd_extreme_comparisons)]
27074 #[allow(unused_comparisons)]
27075 if __tmp.remaining() < Self::ENCODED_LEN {
27076 panic!(
27077 "buffer is too small (need {} bytes, but got {})",
27078 Self::ENCODED_LEN,
27079 __tmp.remaining(),
27080 )
27081 }
27082 __tmp.put_u32_le(self.time_boot_ms);
27083 __tmp.put_f32_le(self.press_abs);
27084 __tmp.put_f32_le(self.press_diff);
27085 __tmp.put_i16_le(self.temperature);
27086 __tmp.put_i16_le(self.temperature_press_diff);
27087 if matches!(version, MavlinkVersion::V2) {
27088 let len = __tmp.len();
27089 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27090 } else {
27091 __tmp.len()
27092 }
27093 }
27094}
27095#[doc = "id: 126"]
27096#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27097#[derive(Debug, Clone, PartialEq)]
27098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27099#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27100pub struct SERIAL_CONTROL_DATA {
27101 #[doc = "Baudrate of transfer. Zero means no change."]
27102 pub baudrate: u32,
27103 #[doc = "Timeout for reply data"]
27104 pub timeout: u16,
27105 #[doc = "Serial control device type."]
27106 pub device: SerialControlDev,
27107 #[doc = "Bitmap of serial control flags."]
27108 pub flags: SerialControlFlag,
27109 #[doc = "how many bytes in this transfer"]
27110 pub count: u8,
27111 #[doc = "serial data"]
27112 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27113 pub data: [u8; 70],
27114 #[doc = "System ID"]
27115 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27116 pub target_system: u8,
27117 #[doc = "Component ID"]
27118 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27119 pub target_component: u8,
27120}
27121impl SERIAL_CONTROL_DATA {
27122 pub const ENCODED_LEN: usize = 81usize;
27123 pub const DEFAULT: Self = Self {
27124 baudrate: 0_u32,
27125 timeout: 0_u16,
27126 device: SerialControlDev::DEFAULT,
27127 flags: SerialControlFlag::DEFAULT,
27128 count: 0_u8,
27129 data: [0_u8; 70usize],
27130 target_system: 0_u8,
27131 target_component: 0_u8,
27132 };
27133 #[cfg(feature = "arbitrary")]
27134 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27135 use arbitrary::{Arbitrary, Unstructured};
27136 let mut buf = [0u8; 1024];
27137 rng.fill_bytes(&mut buf);
27138 let mut unstructured = Unstructured::new(&buf);
27139 Self::arbitrary(&mut unstructured).unwrap_or_default()
27140 }
27141}
27142impl Default for SERIAL_CONTROL_DATA {
27143 fn default() -> Self {
27144 Self::DEFAULT.clone()
27145 }
27146}
27147impl MessageData for SERIAL_CONTROL_DATA {
27148 type Message = MavMessage;
27149 const ID: u32 = 126u32;
27150 const NAME: &'static str = "SERIAL_CONTROL";
27151 const EXTRA_CRC: u8 = 220u8;
27152 const ENCODED_LEN: usize = 81usize;
27153 fn deser(
27154 _version: MavlinkVersion,
27155 __input: &[u8],
27156 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27157 let avail_len = __input.len();
27158 let mut payload_buf = [0; Self::ENCODED_LEN];
27159 let mut buf = if avail_len < Self::ENCODED_LEN {
27160 payload_buf[0..avail_len].copy_from_slice(__input);
27161 Bytes::new(&payload_buf)
27162 } else {
27163 Bytes::new(__input)
27164 };
27165 let mut __struct = Self::default();
27166 __struct.baudrate = buf.get_u32_le();
27167 __struct.timeout = buf.get_u16_le();
27168 let tmp = buf.get_u8();
27169 __struct.device =
27170 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27171 enum_type: "SerialControlDev",
27172 value: tmp as u32,
27173 })?;
27174 let tmp = buf.get_u8();
27175 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
27176 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27177 flag_type: "SerialControlFlag",
27178 value: tmp as u32,
27179 })?;
27180 __struct.count = buf.get_u8();
27181 for v in &mut __struct.data {
27182 let val = buf.get_u8();
27183 *v = val;
27184 }
27185 __struct.target_system = buf.get_u8();
27186 __struct.target_component = buf.get_u8();
27187 Ok(__struct)
27188 }
27189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27190 let mut __tmp = BytesMut::new(bytes);
27191 #[allow(clippy::absurd_extreme_comparisons)]
27192 #[allow(unused_comparisons)]
27193 if __tmp.remaining() < Self::ENCODED_LEN {
27194 panic!(
27195 "buffer is too small (need {} bytes, but got {})",
27196 Self::ENCODED_LEN,
27197 __tmp.remaining(),
27198 )
27199 }
27200 __tmp.put_u32_le(self.baudrate);
27201 __tmp.put_u16_le(self.timeout);
27202 __tmp.put_u8(self.device as u8);
27203 __tmp.put_u8(self.flags.bits());
27204 __tmp.put_u8(self.count);
27205 for val in &self.data {
27206 __tmp.put_u8(*val);
27207 }
27208 __tmp.put_u8(self.target_system);
27209 __tmp.put_u8(self.target_component);
27210 if matches!(version, MavlinkVersion::V2) {
27211 let len = __tmp.len();
27212 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27213 } else {
27214 __tmp.len()
27215 }
27216 }
27217}
27218#[doc = "id: 36"]
27219#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
27220#[derive(Debug, Clone, PartialEq)]
27221#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27222#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27223pub struct SERVO_OUTPUT_RAW_DATA {
27224 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27225 pub time_usec: u32,
27226 #[doc = "Servo output 1 value"]
27227 pub servo1_raw: u16,
27228 #[doc = "Servo output 2 value"]
27229 pub servo2_raw: u16,
27230 #[doc = "Servo output 3 value"]
27231 pub servo3_raw: u16,
27232 #[doc = "Servo output 4 value"]
27233 pub servo4_raw: u16,
27234 #[doc = "Servo output 5 value"]
27235 pub servo5_raw: u16,
27236 #[doc = "Servo output 6 value"]
27237 pub servo6_raw: u16,
27238 #[doc = "Servo output 7 value"]
27239 pub servo7_raw: u16,
27240 #[doc = "Servo output 8 value"]
27241 pub servo8_raw: u16,
27242 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27243 pub port: u8,
27244 #[doc = "Servo output 9 value"]
27245 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27246 pub servo9_raw: u16,
27247 #[doc = "Servo output 10 value"]
27248 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27249 pub servo10_raw: u16,
27250 #[doc = "Servo output 11 value"]
27251 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27252 pub servo11_raw: u16,
27253 #[doc = "Servo output 12 value"]
27254 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27255 pub servo12_raw: u16,
27256 #[doc = "Servo output 13 value"]
27257 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27258 pub servo13_raw: u16,
27259 #[doc = "Servo output 14 value"]
27260 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27261 pub servo14_raw: u16,
27262 #[doc = "Servo output 15 value"]
27263 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27264 pub servo15_raw: u16,
27265 #[doc = "Servo output 16 value"]
27266 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27267 pub servo16_raw: u16,
27268}
27269impl SERVO_OUTPUT_RAW_DATA {
27270 pub const ENCODED_LEN: usize = 37usize;
27271 pub const DEFAULT: Self = Self {
27272 time_usec: 0_u32,
27273 servo1_raw: 0_u16,
27274 servo2_raw: 0_u16,
27275 servo3_raw: 0_u16,
27276 servo4_raw: 0_u16,
27277 servo5_raw: 0_u16,
27278 servo6_raw: 0_u16,
27279 servo7_raw: 0_u16,
27280 servo8_raw: 0_u16,
27281 port: 0_u8,
27282 servo9_raw: 0_u16,
27283 servo10_raw: 0_u16,
27284 servo11_raw: 0_u16,
27285 servo12_raw: 0_u16,
27286 servo13_raw: 0_u16,
27287 servo14_raw: 0_u16,
27288 servo15_raw: 0_u16,
27289 servo16_raw: 0_u16,
27290 };
27291 #[cfg(feature = "arbitrary")]
27292 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27293 use arbitrary::{Arbitrary, Unstructured};
27294 let mut buf = [0u8; 1024];
27295 rng.fill_bytes(&mut buf);
27296 let mut unstructured = Unstructured::new(&buf);
27297 Self::arbitrary(&mut unstructured).unwrap_or_default()
27298 }
27299}
27300impl Default for SERVO_OUTPUT_RAW_DATA {
27301 fn default() -> Self {
27302 Self::DEFAULT.clone()
27303 }
27304}
27305impl MessageData for SERVO_OUTPUT_RAW_DATA {
27306 type Message = MavMessage;
27307 const ID: u32 = 36u32;
27308 const NAME: &'static str = "SERVO_OUTPUT_RAW";
27309 const EXTRA_CRC: u8 = 222u8;
27310 const ENCODED_LEN: usize = 37usize;
27311 fn deser(
27312 _version: MavlinkVersion,
27313 __input: &[u8],
27314 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27315 let avail_len = __input.len();
27316 let mut payload_buf = [0; Self::ENCODED_LEN];
27317 let mut buf = if avail_len < Self::ENCODED_LEN {
27318 payload_buf[0..avail_len].copy_from_slice(__input);
27319 Bytes::new(&payload_buf)
27320 } else {
27321 Bytes::new(__input)
27322 };
27323 let mut __struct = Self::default();
27324 __struct.time_usec = buf.get_u32_le();
27325 __struct.servo1_raw = buf.get_u16_le();
27326 __struct.servo2_raw = buf.get_u16_le();
27327 __struct.servo3_raw = buf.get_u16_le();
27328 __struct.servo4_raw = buf.get_u16_le();
27329 __struct.servo5_raw = buf.get_u16_le();
27330 __struct.servo6_raw = buf.get_u16_le();
27331 __struct.servo7_raw = buf.get_u16_le();
27332 __struct.servo8_raw = buf.get_u16_le();
27333 __struct.port = buf.get_u8();
27334 __struct.servo9_raw = buf.get_u16_le();
27335 __struct.servo10_raw = buf.get_u16_le();
27336 __struct.servo11_raw = buf.get_u16_le();
27337 __struct.servo12_raw = buf.get_u16_le();
27338 __struct.servo13_raw = buf.get_u16_le();
27339 __struct.servo14_raw = buf.get_u16_le();
27340 __struct.servo15_raw = buf.get_u16_le();
27341 __struct.servo16_raw = buf.get_u16_le();
27342 Ok(__struct)
27343 }
27344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27345 let mut __tmp = BytesMut::new(bytes);
27346 #[allow(clippy::absurd_extreme_comparisons)]
27347 #[allow(unused_comparisons)]
27348 if __tmp.remaining() < Self::ENCODED_LEN {
27349 panic!(
27350 "buffer is too small (need {} bytes, but got {})",
27351 Self::ENCODED_LEN,
27352 __tmp.remaining(),
27353 )
27354 }
27355 __tmp.put_u32_le(self.time_usec);
27356 __tmp.put_u16_le(self.servo1_raw);
27357 __tmp.put_u16_le(self.servo2_raw);
27358 __tmp.put_u16_le(self.servo3_raw);
27359 __tmp.put_u16_le(self.servo4_raw);
27360 __tmp.put_u16_le(self.servo5_raw);
27361 __tmp.put_u16_le(self.servo6_raw);
27362 __tmp.put_u16_le(self.servo7_raw);
27363 __tmp.put_u16_le(self.servo8_raw);
27364 __tmp.put_u8(self.port);
27365 __tmp.put_u16_le(self.servo9_raw);
27366 __tmp.put_u16_le(self.servo10_raw);
27367 __tmp.put_u16_le(self.servo11_raw);
27368 __tmp.put_u16_le(self.servo12_raw);
27369 __tmp.put_u16_le(self.servo13_raw);
27370 __tmp.put_u16_le(self.servo14_raw);
27371 __tmp.put_u16_le(self.servo15_raw);
27372 __tmp.put_u16_le(self.servo16_raw);
27373 if matches!(version, MavlinkVersion::V2) {
27374 let len = __tmp.len();
27375 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27376 } else {
27377 __tmp.len()
27378 }
27379 }
27380}
27381#[doc = "id: 256"]
27382#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
27383#[derive(Debug, Clone, PartialEq)]
27384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27385#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27386pub struct SETUP_SIGNING_DATA {
27387 #[doc = "initial timestamp"]
27388 pub initial_timestamp: u64,
27389 #[doc = "system id of the target"]
27390 pub target_system: u8,
27391 #[doc = "component ID of the target"]
27392 pub target_component: u8,
27393 #[doc = "signing key"]
27394 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27395 pub secret_key: [u8; 32],
27396}
27397impl SETUP_SIGNING_DATA {
27398 pub const ENCODED_LEN: usize = 42usize;
27399 pub const DEFAULT: Self = Self {
27400 initial_timestamp: 0_u64,
27401 target_system: 0_u8,
27402 target_component: 0_u8,
27403 secret_key: [0_u8; 32usize],
27404 };
27405 #[cfg(feature = "arbitrary")]
27406 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27407 use arbitrary::{Arbitrary, Unstructured};
27408 let mut buf = [0u8; 1024];
27409 rng.fill_bytes(&mut buf);
27410 let mut unstructured = Unstructured::new(&buf);
27411 Self::arbitrary(&mut unstructured).unwrap_or_default()
27412 }
27413}
27414impl Default for SETUP_SIGNING_DATA {
27415 fn default() -> Self {
27416 Self::DEFAULT.clone()
27417 }
27418}
27419impl MessageData for SETUP_SIGNING_DATA {
27420 type Message = MavMessage;
27421 const ID: u32 = 256u32;
27422 const NAME: &'static str = "SETUP_SIGNING";
27423 const EXTRA_CRC: u8 = 71u8;
27424 const ENCODED_LEN: usize = 42usize;
27425 fn deser(
27426 _version: MavlinkVersion,
27427 __input: &[u8],
27428 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27429 let avail_len = __input.len();
27430 let mut payload_buf = [0; Self::ENCODED_LEN];
27431 let mut buf = if avail_len < Self::ENCODED_LEN {
27432 payload_buf[0..avail_len].copy_from_slice(__input);
27433 Bytes::new(&payload_buf)
27434 } else {
27435 Bytes::new(__input)
27436 };
27437 let mut __struct = Self::default();
27438 __struct.initial_timestamp = buf.get_u64_le();
27439 __struct.target_system = buf.get_u8();
27440 __struct.target_component = buf.get_u8();
27441 for v in &mut __struct.secret_key {
27442 let val = buf.get_u8();
27443 *v = val;
27444 }
27445 Ok(__struct)
27446 }
27447 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27448 let mut __tmp = BytesMut::new(bytes);
27449 #[allow(clippy::absurd_extreme_comparisons)]
27450 #[allow(unused_comparisons)]
27451 if __tmp.remaining() < Self::ENCODED_LEN {
27452 panic!(
27453 "buffer is too small (need {} bytes, but got {})",
27454 Self::ENCODED_LEN,
27455 __tmp.remaining(),
27456 )
27457 }
27458 __tmp.put_u64_le(self.initial_timestamp);
27459 __tmp.put_u8(self.target_system);
27460 __tmp.put_u8(self.target_component);
27461 for val in &self.secret_key {
27462 __tmp.put_u8(*val);
27463 }
27464 if matches!(version, MavlinkVersion::V2) {
27465 let len = __tmp.len();
27466 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27467 } else {
27468 __tmp.len()
27469 }
27470 }
27471}
27472#[doc = "id: 139"]
27473#[doc = "Set the vehicle attitude and body angular rates."]
27474#[derive(Debug, Clone, PartialEq)]
27475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27477pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
27478 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27479 pub time_usec: u64,
27480 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
27481 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27482 pub controls: [f32; 8],
27483 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
27484 pub group_mlx: u8,
27485 #[doc = "System ID"]
27486 pub target_system: u8,
27487 #[doc = "Component ID"]
27488 pub target_component: u8,
27489}
27490impl SET_ACTUATOR_CONTROL_TARGET_DATA {
27491 pub const ENCODED_LEN: usize = 43usize;
27492 pub const DEFAULT: Self = Self {
27493 time_usec: 0_u64,
27494 controls: [0.0_f32; 8usize],
27495 group_mlx: 0_u8,
27496 target_system: 0_u8,
27497 target_component: 0_u8,
27498 };
27499 #[cfg(feature = "arbitrary")]
27500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27501 use arbitrary::{Arbitrary, Unstructured};
27502 let mut buf = [0u8; 1024];
27503 rng.fill_bytes(&mut buf);
27504 let mut unstructured = Unstructured::new(&buf);
27505 Self::arbitrary(&mut unstructured).unwrap_or_default()
27506 }
27507}
27508impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
27509 fn default() -> Self {
27510 Self::DEFAULT.clone()
27511 }
27512}
27513impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
27514 type Message = MavMessage;
27515 const ID: u32 = 139u32;
27516 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
27517 const EXTRA_CRC: u8 = 168u8;
27518 const ENCODED_LEN: usize = 43usize;
27519 fn deser(
27520 _version: MavlinkVersion,
27521 __input: &[u8],
27522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27523 let avail_len = __input.len();
27524 let mut payload_buf = [0; Self::ENCODED_LEN];
27525 let mut buf = if avail_len < Self::ENCODED_LEN {
27526 payload_buf[0..avail_len].copy_from_slice(__input);
27527 Bytes::new(&payload_buf)
27528 } else {
27529 Bytes::new(__input)
27530 };
27531 let mut __struct = Self::default();
27532 __struct.time_usec = buf.get_u64_le();
27533 for v in &mut __struct.controls {
27534 let val = buf.get_f32_le();
27535 *v = val;
27536 }
27537 __struct.group_mlx = buf.get_u8();
27538 __struct.target_system = buf.get_u8();
27539 __struct.target_component = buf.get_u8();
27540 Ok(__struct)
27541 }
27542 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27543 let mut __tmp = BytesMut::new(bytes);
27544 #[allow(clippy::absurd_extreme_comparisons)]
27545 #[allow(unused_comparisons)]
27546 if __tmp.remaining() < Self::ENCODED_LEN {
27547 panic!(
27548 "buffer is too small (need {} bytes, but got {})",
27549 Self::ENCODED_LEN,
27550 __tmp.remaining(),
27551 )
27552 }
27553 __tmp.put_u64_le(self.time_usec);
27554 for val in &self.controls {
27555 __tmp.put_f32_le(*val);
27556 }
27557 __tmp.put_u8(self.group_mlx);
27558 __tmp.put_u8(self.target_system);
27559 __tmp.put_u8(self.target_component);
27560 if matches!(version, MavlinkVersion::V2) {
27561 let len = __tmp.len();
27562 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27563 } else {
27564 __tmp.len()
27565 }
27566 }
27567}
27568#[doc = "id: 82"]
27569#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27570#[derive(Debug, Clone, PartialEq)]
27571#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27572#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27573pub struct SET_ATTITUDE_TARGET_DATA {
27574 #[doc = "Timestamp (time since system boot)."]
27575 pub time_boot_ms: u32,
27576 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27577 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27578 pub q: [f32; 4],
27579 #[doc = "Body roll rate"]
27580 pub body_roll_rate: f32,
27581 #[doc = "Body pitch rate"]
27582 pub body_pitch_rate: f32,
27583 #[doc = "Body yaw rate"]
27584 pub body_yaw_rate: f32,
27585 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27586 pub thrust: f32,
27587 #[doc = "System ID"]
27588 pub target_system: u8,
27589 #[doc = "Component ID"]
27590 pub target_component: u8,
27591 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27592 pub type_mask: AttitudeTargetTypemask,
27593 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
27594 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27595 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27596 pub thrust_body: [f32; 3],
27597}
27598impl SET_ATTITUDE_TARGET_DATA {
27599 pub const ENCODED_LEN: usize = 51usize;
27600 pub const DEFAULT: Self = Self {
27601 time_boot_ms: 0_u32,
27602 q: [0.0_f32; 4usize],
27603 body_roll_rate: 0.0_f32,
27604 body_pitch_rate: 0.0_f32,
27605 body_yaw_rate: 0.0_f32,
27606 thrust: 0.0_f32,
27607 target_system: 0_u8,
27608 target_component: 0_u8,
27609 type_mask: AttitudeTargetTypemask::DEFAULT,
27610 thrust_body: [0.0_f32; 3usize],
27611 };
27612 #[cfg(feature = "arbitrary")]
27613 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27614 use arbitrary::{Arbitrary, Unstructured};
27615 let mut buf = [0u8; 1024];
27616 rng.fill_bytes(&mut buf);
27617 let mut unstructured = Unstructured::new(&buf);
27618 Self::arbitrary(&mut unstructured).unwrap_or_default()
27619 }
27620}
27621impl Default for SET_ATTITUDE_TARGET_DATA {
27622 fn default() -> Self {
27623 Self::DEFAULT.clone()
27624 }
27625}
27626impl MessageData for SET_ATTITUDE_TARGET_DATA {
27627 type Message = MavMessage;
27628 const ID: u32 = 82u32;
27629 const NAME: &'static str = "SET_ATTITUDE_TARGET";
27630 const EXTRA_CRC: u8 = 49u8;
27631 const ENCODED_LEN: usize = 51usize;
27632 fn deser(
27633 _version: MavlinkVersion,
27634 __input: &[u8],
27635 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27636 let avail_len = __input.len();
27637 let mut payload_buf = [0; Self::ENCODED_LEN];
27638 let mut buf = if avail_len < Self::ENCODED_LEN {
27639 payload_buf[0..avail_len].copy_from_slice(__input);
27640 Bytes::new(&payload_buf)
27641 } else {
27642 Bytes::new(__input)
27643 };
27644 let mut __struct = Self::default();
27645 __struct.time_boot_ms = buf.get_u32_le();
27646 for v in &mut __struct.q {
27647 let val = buf.get_f32_le();
27648 *v = val;
27649 }
27650 __struct.body_roll_rate = buf.get_f32_le();
27651 __struct.body_pitch_rate = buf.get_f32_le();
27652 __struct.body_yaw_rate = buf.get_f32_le();
27653 __struct.thrust = buf.get_f32_le();
27654 __struct.target_system = buf.get_u8();
27655 __struct.target_component = buf.get_u8();
27656 let tmp = buf.get_u8();
27657 __struct.type_mask = AttitudeTargetTypemask::from_bits(
27658 tmp & AttitudeTargetTypemask::all().bits(),
27659 )
27660 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27661 flag_type: "AttitudeTargetTypemask",
27662 value: tmp as u32,
27663 })?;
27664 for v in &mut __struct.thrust_body {
27665 let val = buf.get_f32_le();
27666 *v = val;
27667 }
27668 Ok(__struct)
27669 }
27670 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27671 let mut __tmp = BytesMut::new(bytes);
27672 #[allow(clippy::absurd_extreme_comparisons)]
27673 #[allow(unused_comparisons)]
27674 if __tmp.remaining() < Self::ENCODED_LEN {
27675 panic!(
27676 "buffer is too small (need {} bytes, but got {})",
27677 Self::ENCODED_LEN,
27678 __tmp.remaining(),
27679 )
27680 }
27681 __tmp.put_u32_le(self.time_boot_ms);
27682 for val in &self.q {
27683 __tmp.put_f32_le(*val);
27684 }
27685 __tmp.put_f32_le(self.body_roll_rate);
27686 __tmp.put_f32_le(self.body_pitch_rate);
27687 __tmp.put_f32_le(self.body_yaw_rate);
27688 __tmp.put_f32_le(self.thrust);
27689 __tmp.put_u8(self.target_system);
27690 __tmp.put_u8(self.target_component);
27691 __tmp.put_u8(self.type_mask.bits());
27692 for val in &self.thrust_body {
27693 __tmp.put_f32_le(*val);
27694 }
27695 if matches!(version, MavlinkVersion::V2) {
27696 let len = __tmp.len();
27697 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27698 } else {
27699 __tmp.len()
27700 }
27701 }
27702}
27703#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
27704#[doc = "id: 48"]
27705#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27706#[derive(Debug, Clone, PartialEq)]
27707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27709pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27710 #[doc = "Latitude (WGS84)"]
27711 pub latitude: i32,
27712 #[doc = "Longitude (WGS84)"]
27713 pub longitude: i32,
27714 #[doc = "Altitude (MSL). Positive for up."]
27715 pub altitude: i32,
27716 #[doc = "System ID"]
27717 pub target_system: u8,
27718 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27719 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27720 pub time_usec: u64,
27721}
27722impl SET_GPS_GLOBAL_ORIGIN_DATA {
27723 pub const ENCODED_LEN: usize = 21usize;
27724 pub const DEFAULT: Self = Self {
27725 latitude: 0_i32,
27726 longitude: 0_i32,
27727 altitude: 0_i32,
27728 target_system: 0_u8,
27729 time_usec: 0_u64,
27730 };
27731 #[cfg(feature = "arbitrary")]
27732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27733 use arbitrary::{Arbitrary, Unstructured};
27734 let mut buf = [0u8; 1024];
27735 rng.fill_bytes(&mut buf);
27736 let mut unstructured = Unstructured::new(&buf);
27737 Self::arbitrary(&mut unstructured).unwrap_or_default()
27738 }
27739}
27740impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
27741 fn default() -> Self {
27742 Self::DEFAULT.clone()
27743 }
27744}
27745impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
27746 type Message = MavMessage;
27747 const ID: u32 = 48u32;
27748 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
27749 const EXTRA_CRC: u8 = 41u8;
27750 const ENCODED_LEN: usize = 21usize;
27751 fn deser(
27752 _version: MavlinkVersion,
27753 __input: &[u8],
27754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27755 let avail_len = __input.len();
27756 let mut payload_buf = [0; Self::ENCODED_LEN];
27757 let mut buf = if avail_len < Self::ENCODED_LEN {
27758 payload_buf[0..avail_len].copy_from_slice(__input);
27759 Bytes::new(&payload_buf)
27760 } else {
27761 Bytes::new(__input)
27762 };
27763 let mut __struct = Self::default();
27764 __struct.latitude = buf.get_i32_le();
27765 __struct.longitude = buf.get_i32_le();
27766 __struct.altitude = buf.get_i32_le();
27767 __struct.target_system = buf.get_u8();
27768 __struct.time_usec = buf.get_u64_le();
27769 Ok(__struct)
27770 }
27771 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27772 let mut __tmp = BytesMut::new(bytes);
27773 #[allow(clippy::absurd_extreme_comparisons)]
27774 #[allow(unused_comparisons)]
27775 if __tmp.remaining() < Self::ENCODED_LEN {
27776 panic!(
27777 "buffer is too small (need {} bytes, but got {})",
27778 Self::ENCODED_LEN,
27779 __tmp.remaining(),
27780 )
27781 }
27782 __tmp.put_i32_le(self.latitude);
27783 __tmp.put_i32_le(self.longitude);
27784 __tmp.put_i32_le(self.altitude);
27785 __tmp.put_u8(self.target_system);
27786 __tmp.put_u64_le(self.time_usec);
27787 if matches!(version, MavlinkVersion::V2) {
27788 let len = __tmp.len();
27789 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27790 } else {
27791 __tmp.len()
27792 }
27793 }
27794}
27795#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
27796#[doc = "id: 243"]
27797#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
27798#[derive(Debug, Clone, PartialEq)]
27799#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27801pub struct SET_HOME_POSITION_DATA {
27802 #[doc = "Latitude (WGS84)"]
27803 pub latitude: i32,
27804 #[doc = "Longitude (WGS84)"]
27805 pub longitude: i32,
27806 #[doc = "Altitude (MSL). Positive for up."]
27807 pub altitude: i32,
27808 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
27809 pub x: f32,
27810 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
27811 pub y: f32,
27812 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27813 pub z: f32,
27814 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
27815 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27816 pub q: [f32; 4],
27817 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27818 pub approach_x: f32,
27819 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27820 pub approach_y: f32,
27821 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27822 pub approach_z: f32,
27823 #[doc = "System ID."]
27824 pub target_system: u8,
27825 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27826 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27827 pub time_usec: u64,
27828}
27829impl SET_HOME_POSITION_DATA {
27830 pub const ENCODED_LEN: usize = 61usize;
27831 pub const DEFAULT: Self = Self {
27832 latitude: 0_i32,
27833 longitude: 0_i32,
27834 altitude: 0_i32,
27835 x: 0.0_f32,
27836 y: 0.0_f32,
27837 z: 0.0_f32,
27838 q: [0.0_f32; 4usize],
27839 approach_x: 0.0_f32,
27840 approach_y: 0.0_f32,
27841 approach_z: 0.0_f32,
27842 target_system: 0_u8,
27843 time_usec: 0_u64,
27844 };
27845 #[cfg(feature = "arbitrary")]
27846 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27847 use arbitrary::{Arbitrary, Unstructured};
27848 let mut buf = [0u8; 1024];
27849 rng.fill_bytes(&mut buf);
27850 let mut unstructured = Unstructured::new(&buf);
27851 Self::arbitrary(&mut unstructured).unwrap_or_default()
27852 }
27853}
27854impl Default for SET_HOME_POSITION_DATA {
27855 fn default() -> Self {
27856 Self::DEFAULT.clone()
27857 }
27858}
27859impl MessageData for SET_HOME_POSITION_DATA {
27860 type Message = MavMessage;
27861 const ID: u32 = 243u32;
27862 const NAME: &'static str = "SET_HOME_POSITION";
27863 const EXTRA_CRC: u8 = 85u8;
27864 const ENCODED_LEN: usize = 61usize;
27865 fn deser(
27866 _version: MavlinkVersion,
27867 __input: &[u8],
27868 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27869 let avail_len = __input.len();
27870 let mut payload_buf = [0; Self::ENCODED_LEN];
27871 let mut buf = if avail_len < Self::ENCODED_LEN {
27872 payload_buf[0..avail_len].copy_from_slice(__input);
27873 Bytes::new(&payload_buf)
27874 } else {
27875 Bytes::new(__input)
27876 };
27877 let mut __struct = Self::default();
27878 __struct.latitude = buf.get_i32_le();
27879 __struct.longitude = buf.get_i32_le();
27880 __struct.altitude = buf.get_i32_le();
27881 __struct.x = buf.get_f32_le();
27882 __struct.y = buf.get_f32_le();
27883 __struct.z = buf.get_f32_le();
27884 for v in &mut __struct.q {
27885 let val = buf.get_f32_le();
27886 *v = val;
27887 }
27888 __struct.approach_x = buf.get_f32_le();
27889 __struct.approach_y = buf.get_f32_le();
27890 __struct.approach_z = buf.get_f32_le();
27891 __struct.target_system = buf.get_u8();
27892 __struct.time_usec = buf.get_u64_le();
27893 Ok(__struct)
27894 }
27895 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27896 let mut __tmp = BytesMut::new(bytes);
27897 #[allow(clippy::absurd_extreme_comparisons)]
27898 #[allow(unused_comparisons)]
27899 if __tmp.remaining() < Self::ENCODED_LEN {
27900 panic!(
27901 "buffer is too small (need {} bytes, but got {})",
27902 Self::ENCODED_LEN,
27903 __tmp.remaining(),
27904 )
27905 }
27906 __tmp.put_i32_le(self.latitude);
27907 __tmp.put_i32_le(self.longitude);
27908 __tmp.put_i32_le(self.altitude);
27909 __tmp.put_f32_le(self.x);
27910 __tmp.put_f32_le(self.y);
27911 __tmp.put_f32_le(self.z);
27912 for val in &self.q {
27913 __tmp.put_f32_le(*val);
27914 }
27915 __tmp.put_f32_le(self.approach_x);
27916 __tmp.put_f32_le(self.approach_y);
27917 __tmp.put_f32_le(self.approach_z);
27918 __tmp.put_u8(self.target_system);
27919 __tmp.put_u64_le(self.time_usec);
27920 if matches!(version, MavlinkVersion::V2) {
27921 let len = __tmp.len();
27922 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27923 } else {
27924 __tmp.len()
27925 }
27926 }
27927}
27928#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
27929#[doc = "id: 11"]
27930#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
27931#[derive(Debug, Clone, PartialEq)]
27932#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27933#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27934pub struct SET_MODE_DATA {
27935 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
27936 pub custom_mode: u32,
27937 #[doc = "The system setting the mode"]
27938 pub target_system: u8,
27939 #[doc = "The new base mode."]
27940 pub base_mode: MavMode,
27941}
27942impl SET_MODE_DATA {
27943 pub const ENCODED_LEN: usize = 6usize;
27944 pub const DEFAULT: Self = Self {
27945 custom_mode: 0_u32,
27946 target_system: 0_u8,
27947 base_mode: MavMode::DEFAULT,
27948 };
27949 #[cfg(feature = "arbitrary")]
27950 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27951 use arbitrary::{Arbitrary, Unstructured};
27952 let mut buf = [0u8; 1024];
27953 rng.fill_bytes(&mut buf);
27954 let mut unstructured = Unstructured::new(&buf);
27955 Self::arbitrary(&mut unstructured).unwrap_or_default()
27956 }
27957}
27958impl Default for SET_MODE_DATA {
27959 fn default() -> Self {
27960 Self::DEFAULT.clone()
27961 }
27962}
27963impl MessageData for SET_MODE_DATA {
27964 type Message = MavMessage;
27965 const ID: u32 = 11u32;
27966 const NAME: &'static str = "SET_MODE";
27967 const EXTRA_CRC: u8 = 89u8;
27968 const ENCODED_LEN: usize = 6usize;
27969 fn deser(
27970 _version: MavlinkVersion,
27971 __input: &[u8],
27972 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27973 let avail_len = __input.len();
27974 let mut payload_buf = [0; Self::ENCODED_LEN];
27975 let mut buf = if avail_len < Self::ENCODED_LEN {
27976 payload_buf[0..avail_len].copy_from_slice(__input);
27977 Bytes::new(&payload_buf)
27978 } else {
27979 Bytes::new(__input)
27980 };
27981 let mut __struct = Self::default();
27982 __struct.custom_mode = buf.get_u32_le();
27983 __struct.target_system = buf.get_u8();
27984 let tmp = buf.get_u8();
27985 __struct.base_mode =
27986 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27987 enum_type: "MavMode",
27988 value: tmp as u32,
27989 })?;
27990 Ok(__struct)
27991 }
27992 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27993 let mut __tmp = BytesMut::new(bytes);
27994 #[allow(clippy::absurd_extreme_comparisons)]
27995 #[allow(unused_comparisons)]
27996 if __tmp.remaining() < Self::ENCODED_LEN {
27997 panic!(
27998 "buffer is too small (need {} bytes, but got {})",
27999 Self::ENCODED_LEN,
28000 __tmp.remaining(),
28001 )
28002 }
28003 __tmp.put_u32_le(self.custom_mode);
28004 __tmp.put_u8(self.target_system);
28005 __tmp.put_u8(self.base_mode as u8);
28006 if matches!(version, MavlinkVersion::V2) {
28007 let len = __tmp.len();
28008 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28009 } else {
28010 __tmp.len()
28011 }
28012 }
28013}
28014#[doc = "id: 86"]
28015#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
28016#[derive(Debug, Clone, PartialEq)]
28017#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28018#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28019pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
28020 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
28021 pub time_boot_ms: u32,
28022 #[doc = "Latitude in WGS84 frame"]
28023 pub lat_int: i32,
28024 #[doc = "Longitude in WGS84 frame"]
28025 pub lon_int: i32,
28026 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
28027 pub alt: f32,
28028 #[doc = "X velocity in NED frame"]
28029 pub vx: f32,
28030 #[doc = "Y velocity in NED frame"]
28031 pub vy: f32,
28032 #[doc = "Z velocity in NED frame"]
28033 pub vz: f32,
28034 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28035 pub afx: f32,
28036 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28037 pub afy: f32,
28038 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28039 pub afz: f32,
28040 #[doc = "yaw setpoint"]
28041 pub yaw: f32,
28042 #[doc = "yaw rate setpoint"]
28043 pub yaw_rate: f32,
28044 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28045 pub type_mask: PositionTargetTypemask,
28046 #[doc = "System ID"]
28047 pub target_system: u8,
28048 #[doc = "Component ID"]
28049 pub target_component: u8,
28050 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28051 pub coordinate_frame: MavFrame,
28052}
28053impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28054 pub const ENCODED_LEN: usize = 53usize;
28055 pub const DEFAULT: Self = Self {
28056 time_boot_ms: 0_u32,
28057 lat_int: 0_i32,
28058 lon_int: 0_i32,
28059 alt: 0.0_f32,
28060 vx: 0.0_f32,
28061 vy: 0.0_f32,
28062 vz: 0.0_f32,
28063 afx: 0.0_f32,
28064 afy: 0.0_f32,
28065 afz: 0.0_f32,
28066 yaw: 0.0_f32,
28067 yaw_rate: 0.0_f32,
28068 type_mask: PositionTargetTypemask::DEFAULT,
28069 target_system: 0_u8,
28070 target_component: 0_u8,
28071 coordinate_frame: MavFrame::DEFAULT,
28072 };
28073 #[cfg(feature = "arbitrary")]
28074 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28075 use arbitrary::{Arbitrary, Unstructured};
28076 let mut buf = [0u8; 1024];
28077 rng.fill_bytes(&mut buf);
28078 let mut unstructured = Unstructured::new(&buf);
28079 Self::arbitrary(&mut unstructured).unwrap_or_default()
28080 }
28081}
28082impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28083 fn default() -> Self {
28084 Self::DEFAULT.clone()
28085 }
28086}
28087impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28088 type Message = MavMessage;
28089 const ID: u32 = 86u32;
28090 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28091 const EXTRA_CRC: u8 = 5u8;
28092 const ENCODED_LEN: usize = 53usize;
28093 fn deser(
28094 _version: MavlinkVersion,
28095 __input: &[u8],
28096 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28097 let avail_len = __input.len();
28098 let mut payload_buf = [0; Self::ENCODED_LEN];
28099 let mut buf = if avail_len < Self::ENCODED_LEN {
28100 payload_buf[0..avail_len].copy_from_slice(__input);
28101 Bytes::new(&payload_buf)
28102 } else {
28103 Bytes::new(__input)
28104 };
28105 let mut __struct = Self::default();
28106 __struct.time_boot_ms = buf.get_u32_le();
28107 __struct.lat_int = buf.get_i32_le();
28108 __struct.lon_int = buf.get_i32_le();
28109 __struct.alt = buf.get_f32_le();
28110 __struct.vx = buf.get_f32_le();
28111 __struct.vy = buf.get_f32_le();
28112 __struct.vz = buf.get_f32_le();
28113 __struct.afx = buf.get_f32_le();
28114 __struct.afy = buf.get_f32_le();
28115 __struct.afz = buf.get_f32_le();
28116 __struct.yaw = buf.get_f32_le();
28117 __struct.yaw_rate = buf.get_f32_le();
28118 let tmp = buf.get_u16_le();
28119 __struct.type_mask = PositionTargetTypemask::from_bits(
28120 tmp & PositionTargetTypemask::all().bits(),
28121 )
28122 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28123 flag_type: "PositionTargetTypemask",
28124 value: tmp as u32,
28125 })?;
28126 __struct.target_system = buf.get_u8();
28127 __struct.target_component = buf.get_u8();
28128 let tmp = buf.get_u8();
28129 __struct.coordinate_frame =
28130 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28131 enum_type: "MavFrame",
28132 value: tmp as u32,
28133 })?;
28134 Ok(__struct)
28135 }
28136 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28137 let mut __tmp = BytesMut::new(bytes);
28138 #[allow(clippy::absurd_extreme_comparisons)]
28139 #[allow(unused_comparisons)]
28140 if __tmp.remaining() < Self::ENCODED_LEN {
28141 panic!(
28142 "buffer is too small (need {} bytes, but got {})",
28143 Self::ENCODED_LEN,
28144 __tmp.remaining(),
28145 )
28146 }
28147 __tmp.put_u32_le(self.time_boot_ms);
28148 __tmp.put_i32_le(self.lat_int);
28149 __tmp.put_i32_le(self.lon_int);
28150 __tmp.put_f32_le(self.alt);
28151 __tmp.put_f32_le(self.vx);
28152 __tmp.put_f32_le(self.vy);
28153 __tmp.put_f32_le(self.vz);
28154 __tmp.put_f32_le(self.afx);
28155 __tmp.put_f32_le(self.afy);
28156 __tmp.put_f32_le(self.afz);
28157 __tmp.put_f32_le(self.yaw);
28158 __tmp.put_f32_le(self.yaw_rate);
28159 __tmp.put_u16_le(self.type_mask.bits());
28160 __tmp.put_u8(self.target_system);
28161 __tmp.put_u8(self.target_component);
28162 __tmp.put_u8(self.coordinate_frame as u8);
28163 if matches!(version, MavlinkVersion::V2) {
28164 let len = __tmp.len();
28165 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28166 } else {
28167 __tmp.len()
28168 }
28169 }
28170}
28171#[doc = "id: 84"]
28172#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
28173#[derive(Debug, Clone, PartialEq)]
28174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28175#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28176pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
28177 #[doc = "Timestamp (time since system boot)."]
28178 pub time_boot_ms: u32,
28179 #[doc = "X Position in NED frame"]
28180 pub x: f32,
28181 #[doc = "Y Position in NED frame"]
28182 pub y: f32,
28183 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
28184 pub z: f32,
28185 #[doc = "X velocity in NED frame"]
28186 pub vx: f32,
28187 #[doc = "Y velocity in NED frame"]
28188 pub vy: f32,
28189 #[doc = "Z velocity in NED frame"]
28190 pub vz: f32,
28191 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28192 pub afx: f32,
28193 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28194 pub afy: f32,
28195 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28196 pub afz: f32,
28197 #[doc = "yaw setpoint"]
28198 pub yaw: f32,
28199 #[doc = "yaw rate setpoint"]
28200 pub yaw_rate: f32,
28201 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28202 pub type_mask: PositionTargetTypemask,
28203 #[doc = "System ID"]
28204 pub target_system: u8,
28205 #[doc = "Component ID"]
28206 pub target_component: u8,
28207 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
28208 pub coordinate_frame: MavFrame,
28209}
28210impl SET_POSITION_TARGET_LOCAL_NED_DATA {
28211 pub const ENCODED_LEN: usize = 53usize;
28212 pub const DEFAULT: Self = Self {
28213 time_boot_ms: 0_u32,
28214 x: 0.0_f32,
28215 y: 0.0_f32,
28216 z: 0.0_f32,
28217 vx: 0.0_f32,
28218 vy: 0.0_f32,
28219 vz: 0.0_f32,
28220 afx: 0.0_f32,
28221 afy: 0.0_f32,
28222 afz: 0.0_f32,
28223 yaw: 0.0_f32,
28224 yaw_rate: 0.0_f32,
28225 type_mask: PositionTargetTypemask::DEFAULT,
28226 target_system: 0_u8,
28227 target_component: 0_u8,
28228 coordinate_frame: MavFrame::DEFAULT,
28229 };
28230 #[cfg(feature = "arbitrary")]
28231 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28232 use arbitrary::{Arbitrary, Unstructured};
28233 let mut buf = [0u8; 1024];
28234 rng.fill_bytes(&mut buf);
28235 let mut unstructured = Unstructured::new(&buf);
28236 Self::arbitrary(&mut unstructured).unwrap_or_default()
28237 }
28238}
28239impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
28240 fn default() -> Self {
28241 Self::DEFAULT.clone()
28242 }
28243}
28244impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
28245 type Message = MavMessage;
28246 const ID: u32 = 84u32;
28247 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
28248 const EXTRA_CRC: u8 = 143u8;
28249 const ENCODED_LEN: usize = 53usize;
28250 fn deser(
28251 _version: MavlinkVersion,
28252 __input: &[u8],
28253 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28254 let avail_len = __input.len();
28255 let mut payload_buf = [0; Self::ENCODED_LEN];
28256 let mut buf = if avail_len < Self::ENCODED_LEN {
28257 payload_buf[0..avail_len].copy_from_slice(__input);
28258 Bytes::new(&payload_buf)
28259 } else {
28260 Bytes::new(__input)
28261 };
28262 let mut __struct = Self::default();
28263 __struct.time_boot_ms = buf.get_u32_le();
28264 __struct.x = buf.get_f32_le();
28265 __struct.y = buf.get_f32_le();
28266 __struct.z = buf.get_f32_le();
28267 __struct.vx = buf.get_f32_le();
28268 __struct.vy = buf.get_f32_le();
28269 __struct.vz = buf.get_f32_le();
28270 __struct.afx = buf.get_f32_le();
28271 __struct.afy = buf.get_f32_le();
28272 __struct.afz = buf.get_f32_le();
28273 __struct.yaw = buf.get_f32_le();
28274 __struct.yaw_rate = buf.get_f32_le();
28275 let tmp = buf.get_u16_le();
28276 __struct.type_mask = PositionTargetTypemask::from_bits(
28277 tmp & PositionTargetTypemask::all().bits(),
28278 )
28279 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28280 flag_type: "PositionTargetTypemask",
28281 value: tmp as u32,
28282 })?;
28283 __struct.target_system = buf.get_u8();
28284 __struct.target_component = buf.get_u8();
28285 let tmp = buf.get_u8();
28286 __struct.coordinate_frame =
28287 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28288 enum_type: "MavFrame",
28289 value: tmp as u32,
28290 })?;
28291 Ok(__struct)
28292 }
28293 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28294 let mut __tmp = BytesMut::new(bytes);
28295 #[allow(clippy::absurd_extreme_comparisons)]
28296 #[allow(unused_comparisons)]
28297 if __tmp.remaining() < Self::ENCODED_LEN {
28298 panic!(
28299 "buffer is too small (need {} bytes, but got {})",
28300 Self::ENCODED_LEN,
28301 __tmp.remaining(),
28302 )
28303 }
28304 __tmp.put_u32_le(self.time_boot_ms);
28305 __tmp.put_f32_le(self.x);
28306 __tmp.put_f32_le(self.y);
28307 __tmp.put_f32_le(self.z);
28308 __tmp.put_f32_le(self.vx);
28309 __tmp.put_f32_le(self.vy);
28310 __tmp.put_f32_le(self.vz);
28311 __tmp.put_f32_le(self.afx);
28312 __tmp.put_f32_le(self.afy);
28313 __tmp.put_f32_le(self.afz);
28314 __tmp.put_f32_le(self.yaw);
28315 __tmp.put_f32_le(self.yaw_rate);
28316 __tmp.put_u16_le(self.type_mask.bits());
28317 __tmp.put_u8(self.target_system);
28318 __tmp.put_u8(self.target_component);
28319 __tmp.put_u8(self.coordinate_frame as u8);
28320 if matches!(version, MavlinkVersion::V2) {
28321 let len = __tmp.len();
28322 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28323 } else {
28324 __tmp.len()
28325 }
28326 }
28327}
28328#[doc = "id: 354"]
28329#[doc = "Set temporary maximum limits for horizontal speed, vertical speed and yaw rate. The consumer must stream the current limits in VELOCITY_LIMITS at 1 Hz or more (when limits are being set). The consumer should latch the limits until a new limit is received or the mode is changed."]
28330#[derive(Debug, Clone, PartialEq)]
28331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28332#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28333pub struct SET_VELOCITY_LIMITS_DATA {
28334 #[doc = "Limit for horizontal movement in MAV_FRAME_LOCAL_NED. NaN: Field not used (ignore)"]
28335 pub horizontal_speed_limit: f32,
28336 #[doc = "Limit for vertical movement in MAV_FRAME_LOCAL_NED. NaN: Field not used (ignore)"]
28337 pub vertical_speed_limit: f32,
28338 #[doc = "Limit for vehicle turn rate around its yaw axis. NaN: Field not used (ignore)"]
28339 pub yaw_rate_limit: f32,
28340 #[doc = "System ID (0 for broadcast)."]
28341 pub target_system: u8,
28342 #[doc = "Component ID (0 for broadcast)."]
28343 pub target_component: u8,
28344}
28345impl SET_VELOCITY_LIMITS_DATA {
28346 pub const ENCODED_LEN: usize = 14usize;
28347 pub const DEFAULT: Self = Self {
28348 horizontal_speed_limit: 0.0_f32,
28349 vertical_speed_limit: 0.0_f32,
28350 yaw_rate_limit: 0.0_f32,
28351 target_system: 0_u8,
28352 target_component: 0_u8,
28353 };
28354 #[cfg(feature = "arbitrary")]
28355 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28356 use arbitrary::{Arbitrary, Unstructured};
28357 let mut buf = [0u8; 1024];
28358 rng.fill_bytes(&mut buf);
28359 let mut unstructured = Unstructured::new(&buf);
28360 Self::arbitrary(&mut unstructured).unwrap_or_default()
28361 }
28362}
28363impl Default for SET_VELOCITY_LIMITS_DATA {
28364 fn default() -> Self {
28365 Self::DEFAULT.clone()
28366 }
28367}
28368impl MessageData for SET_VELOCITY_LIMITS_DATA {
28369 type Message = MavMessage;
28370 const ID: u32 = 354u32;
28371 const NAME: &'static str = "SET_VELOCITY_LIMITS";
28372 const EXTRA_CRC: u8 = 210u8;
28373 const ENCODED_LEN: usize = 14usize;
28374 fn deser(
28375 _version: MavlinkVersion,
28376 __input: &[u8],
28377 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28378 let avail_len = __input.len();
28379 let mut payload_buf = [0; Self::ENCODED_LEN];
28380 let mut buf = if avail_len < Self::ENCODED_LEN {
28381 payload_buf[0..avail_len].copy_from_slice(__input);
28382 Bytes::new(&payload_buf)
28383 } else {
28384 Bytes::new(__input)
28385 };
28386 let mut __struct = Self::default();
28387 __struct.horizontal_speed_limit = buf.get_f32_le();
28388 __struct.vertical_speed_limit = buf.get_f32_le();
28389 __struct.yaw_rate_limit = buf.get_f32_le();
28390 __struct.target_system = buf.get_u8();
28391 __struct.target_component = buf.get_u8();
28392 Ok(__struct)
28393 }
28394 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28395 let mut __tmp = BytesMut::new(bytes);
28396 #[allow(clippy::absurd_extreme_comparisons)]
28397 #[allow(unused_comparisons)]
28398 if __tmp.remaining() < Self::ENCODED_LEN {
28399 panic!(
28400 "buffer is too small (need {} bytes, but got {})",
28401 Self::ENCODED_LEN,
28402 __tmp.remaining(),
28403 )
28404 }
28405 __tmp.put_f32_le(self.horizontal_speed_limit);
28406 __tmp.put_f32_le(self.vertical_speed_limit);
28407 __tmp.put_f32_le(self.yaw_rate_limit);
28408 __tmp.put_u8(self.target_system);
28409 __tmp.put_u8(self.target_component);
28410 if matches!(version, MavlinkVersion::V2) {
28411 let len = __tmp.len();
28412 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28413 } else {
28414 __tmp.len()
28415 }
28416 }
28417}
28418#[doc = "id: 108"]
28419#[doc = "Status of simulation environment, if used."]
28420#[derive(Debug, Clone, PartialEq)]
28421#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28422#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28423pub struct SIM_STATE_DATA {
28424 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
28425 pub q1: f32,
28426 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
28427 pub q2: f32,
28428 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
28429 pub q3: f32,
28430 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
28431 pub q4: f32,
28432 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
28433 pub roll: f32,
28434 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
28435 pub pitch: f32,
28436 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
28437 pub yaw: f32,
28438 #[doc = "X acceleration"]
28439 pub xacc: f32,
28440 #[doc = "Y acceleration"]
28441 pub yacc: f32,
28442 #[doc = "Z acceleration"]
28443 pub zacc: f32,
28444 #[doc = "Angular speed around X axis"]
28445 pub xgyro: f32,
28446 #[doc = "Angular speed around Y axis"]
28447 pub ygyro: f32,
28448 #[doc = "Angular speed around Z axis"]
28449 pub zgyro: f32,
28450 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
28451 pub lat: f32,
28452 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
28453 pub lon: f32,
28454 #[doc = "Altitude"]
28455 pub alt: f32,
28456 #[doc = "Horizontal position standard deviation"]
28457 pub std_dev_horz: f32,
28458 #[doc = "Vertical position standard deviation"]
28459 pub std_dev_vert: f32,
28460 #[doc = "True velocity in north direction in earth-fixed NED frame"]
28461 pub vn: f32,
28462 #[doc = "True velocity in east direction in earth-fixed NED frame"]
28463 pub ve: f32,
28464 #[doc = "True velocity in down direction in earth-fixed NED frame"]
28465 pub vd: f32,
28466 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
28467 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28468 pub lat_int: i32,
28469 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
28470 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28471 pub lon_int: i32,
28472}
28473impl SIM_STATE_DATA {
28474 pub const ENCODED_LEN: usize = 92usize;
28475 pub const DEFAULT: Self = Self {
28476 q1: 0.0_f32,
28477 q2: 0.0_f32,
28478 q3: 0.0_f32,
28479 q4: 0.0_f32,
28480 roll: 0.0_f32,
28481 pitch: 0.0_f32,
28482 yaw: 0.0_f32,
28483 xacc: 0.0_f32,
28484 yacc: 0.0_f32,
28485 zacc: 0.0_f32,
28486 xgyro: 0.0_f32,
28487 ygyro: 0.0_f32,
28488 zgyro: 0.0_f32,
28489 lat: 0.0_f32,
28490 lon: 0.0_f32,
28491 alt: 0.0_f32,
28492 std_dev_horz: 0.0_f32,
28493 std_dev_vert: 0.0_f32,
28494 vn: 0.0_f32,
28495 ve: 0.0_f32,
28496 vd: 0.0_f32,
28497 lat_int: 0_i32,
28498 lon_int: 0_i32,
28499 };
28500 #[cfg(feature = "arbitrary")]
28501 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28502 use arbitrary::{Arbitrary, Unstructured};
28503 let mut buf = [0u8; 1024];
28504 rng.fill_bytes(&mut buf);
28505 let mut unstructured = Unstructured::new(&buf);
28506 Self::arbitrary(&mut unstructured).unwrap_or_default()
28507 }
28508}
28509impl Default for SIM_STATE_DATA {
28510 fn default() -> Self {
28511 Self::DEFAULT.clone()
28512 }
28513}
28514impl MessageData for SIM_STATE_DATA {
28515 type Message = MavMessage;
28516 const ID: u32 = 108u32;
28517 const NAME: &'static str = "SIM_STATE";
28518 const EXTRA_CRC: u8 = 32u8;
28519 const ENCODED_LEN: usize = 92usize;
28520 fn deser(
28521 _version: MavlinkVersion,
28522 __input: &[u8],
28523 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28524 let avail_len = __input.len();
28525 let mut payload_buf = [0; Self::ENCODED_LEN];
28526 let mut buf = if avail_len < Self::ENCODED_LEN {
28527 payload_buf[0..avail_len].copy_from_slice(__input);
28528 Bytes::new(&payload_buf)
28529 } else {
28530 Bytes::new(__input)
28531 };
28532 let mut __struct = Self::default();
28533 __struct.q1 = buf.get_f32_le();
28534 __struct.q2 = buf.get_f32_le();
28535 __struct.q3 = buf.get_f32_le();
28536 __struct.q4 = buf.get_f32_le();
28537 __struct.roll = buf.get_f32_le();
28538 __struct.pitch = buf.get_f32_le();
28539 __struct.yaw = buf.get_f32_le();
28540 __struct.xacc = buf.get_f32_le();
28541 __struct.yacc = buf.get_f32_le();
28542 __struct.zacc = buf.get_f32_le();
28543 __struct.xgyro = buf.get_f32_le();
28544 __struct.ygyro = buf.get_f32_le();
28545 __struct.zgyro = buf.get_f32_le();
28546 __struct.lat = buf.get_f32_le();
28547 __struct.lon = buf.get_f32_le();
28548 __struct.alt = buf.get_f32_le();
28549 __struct.std_dev_horz = buf.get_f32_le();
28550 __struct.std_dev_vert = buf.get_f32_le();
28551 __struct.vn = buf.get_f32_le();
28552 __struct.ve = buf.get_f32_le();
28553 __struct.vd = buf.get_f32_le();
28554 __struct.lat_int = buf.get_i32_le();
28555 __struct.lon_int = buf.get_i32_le();
28556 Ok(__struct)
28557 }
28558 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28559 let mut __tmp = BytesMut::new(bytes);
28560 #[allow(clippy::absurd_extreme_comparisons)]
28561 #[allow(unused_comparisons)]
28562 if __tmp.remaining() < Self::ENCODED_LEN {
28563 panic!(
28564 "buffer is too small (need {} bytes, but got {})",
28565 Self::ENCODED_LEN,
28566 __tmp.remaining(),
28567 )
28568 }
28569 __tmp.put_f32_le(self.q1);
28570 __tmp.put_f32_le(self.q2);
28571 __tmp.put_f32_le(self.q3);
28572 __tmp.put_f32_le(self.q4);
28573 __tmp.put_f32_le(self.roll);
28574 __tmp.put_f32_le(self.pitch);
28575 __tmp.put_f32_le(self.yaw);
28576 __tmp.put_f32_le(self.xacc);
28577 __tmp.put_f32_le(self.yacc);
28578 __tmp.put_f32_le(self.zacc);
28579 __tmp.put_f32_le(self.xgyro);
28580 __tmp.put_f32_le(self.ygyro);
28581 __tmp.put_f32_le(self.zgyro);
28582 __tmp.put_f32_le(self.lat);
28583 __tmp.put_f32_le(self.lon);
28584 __tmp.put_f32_le(self.alt);
28585 __tmp.put_f32_le(self.std_dev_horz);
28586 __tmp.put_f32_le(self.std_dev_vert);
28587 __tmp.put_f32_le(self.vn);
28588 __tmp.put_f32_le(self.ve);
28589 __tmp.put_f32_le(self.vd);
28590 __tmp.put_i32_le(self.lat_int);
28591 __tmp.put_i32_le(self.lon_int);
28592 if matches!(version, MavlinkVersion::V2) {
28593 let len = __tmp.len();
28594 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28595 } else {
28596 __tmp.len()
28597 }
28598 }
28599}
28600#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
28601#[doc = "id: 370"]
28602#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
28603#[derive(Debug, Clone, PartialEq)]
28604#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28605#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28606pub struct SMART_BATTERY_INFO_DATA {
28607 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
28608 pub capacity_full_specification: i32,
28609 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28610 pub capacity_full: i32,
28611 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28612 pub cycle_count: u16,
28613 #[doc = "Battery weight. 0: field not provided."]
28614 pub weight: u16,
28615 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28616 pub discharge_minimum_voltage: u16,
28617 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28618 pub charging_minimum_voltage: u16,
28619 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28620 pub resting_minimum_voltage: u16,
28621 #[doc = "Battery ID"]
28622 pub id: u8,
28623 #[doc = "Function of the battery"]
28624 pub battery_function: MavBatteryFunction,
28625 #[doc = "Type (chemistry) of the battery"]
28626 pub mavtype: MavBatteryType,
28627 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28628 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28629 pub serial_number: [u8; 16],
28630 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28631 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28632 pub device_name: [u8; 50],
28633 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28634 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28635 pub charging_maximum_voltage: u16,
28636 #[doc = "Number of battery cells in series. 0: field not provided."]
28637 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28638 pub cells_in_series: u8,
28639 #[doc = "Maximum pack discharge current. 0: field not provided."]
28640 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28641 pub discharge_maximum_current: u32,
28642 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28643 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28644 pub discharge_maximum_burst_current: u32,
28645 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28646 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28647 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28648 pub manufacture_date: [u8; 11],
28649}
28650impl SMART_BATTERY_INFO_DATA {
28651 pub const ENCODED_LEN: usize = 109usize;
28652 pub const DEFAULT: Self = Self {
28653 capacity_full_specification: 0_i32,
28654 capacity_full: 0_i32,
28655 cycle_count: 0_u16,
28656 weight: 0_u16,
28657 discharge_minimum_voltage: 0_u16,
28658 charging_minimum_voltage: 0_u16,
28659 resting_minimum_voltage: 0_u16,
28660 id: 0_u8,
28661 battery_function: MavBatteryFunction::DEFAULT,
28662 mavtype: MavBatteryType::DEFAULT,
28663 serial_number: [0_u8; 16usize],
28664 device_name: [0_u8; 50usize],
28665 charging_maximum_voltage: 0_u16,
28666 cells_in_series: 0_u8,
28667 discharge_maximum_current: 0_u32,
28668 discharge_maximum_burst_current: 0_u32,
28669 manufacture_date: [0_u8; 11usize],
28670 };
28671 #[cfg(feature = "arbitrary")]
28672 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28673 use arbitrary::{Arbitrary, Unstructured};
28674 let mut buf = [0u8; 1024];
28675 rng.fill_bytes(&mut buf);
28676 let mut unstructured = Unstructured::new(&buf);
28677 Self::arbitrary(&mut unstructured).unwrap_or_default()
28678 }
28679}
28680impl Default for SMART_BATTERY_INFO_DATA {
28681 fn default() -> Self {
28682 Self::DEFAULT.clone()
28683 }
28684}
28685impl MessageData for SMART_BATTERY_INFO_DATA {
28686 type Message = MavMessage;
28687 const ID: u32 = 370u32;
28688 const NAME: &'static str = "SMART_BATTERY_INFO";
28689 const EXTRA_CRC: u8 = 75u8;
28690 const ENCODED_LEN: usize = 109usize;
28691 fn deser(
28692 _version: MavlinkVersion,
28693 __input: &[u8],
28694 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28695 let avail_len = __input.len();
28696 let mut payload_buf = [0; Self::ENCODED_LEN];
28697 let mut buf = if avail_len < Self::ENCODED_LEN {
28698 payload_buf[0..avail_len].copy_from_slice(__input);
28699 Bytes::new(&payload_buf)
28700 } else {
28701 Bytes::new(__input)
28702 };
28703 let mut __struct = Self::default();
28704 __struct.capacity_full_specification = buf.get_i32_le();
28705 __struct.capacity_full = buf.get_i32_le();
28706 __struct.cycle_count = buf.get_u16_le();
28707 __struct.weight = buf.get_u16_le();
28708 __struct.discharge_minimum_voltage = buf.get_u16_le();
28709 __struct.charging_minimum_voltage = buf.get_u16_le();
28710 __struct.resting_minimum_voltage = buf.get_u16_le();
28711 __struct.id = buf.get_u8();
28712 let tmp = buf.get_u8();
28713 __struct.battery_function =
28714 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28715 enum_type: "MavBatteryFunction",
28716 value: tmp as u32,
28717 })?;
28718 let tmp = buf.get_u8();
28719 __struct.mavtype =
28720 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28721 enum_type: "MavBatteryType",
28722 value: tmp as u32,
28723 })?;
28724 for v in &mut __struct.serial_number {
28725 let val = buf.get_u8();
28726 *v = val;
28727 }
28728 for v in &mut __struct.device_name {
28729 let val = buf.get_u8();
28730 *v = val;
28731 }
28732 __struct.charging_maximum_voltage = buf.get_u16_le();
28733 __struct.cells_in_series = buf.get_u8();
28734 __struct.discharge_maximum_current = buf.get_u32_le();
28735 __struct.discharge_maximum_burst_current = buf.get_u32_le();
28736 for v in &mut __struct.manufacture_date {
28737 let val = buf.get_u8();
28738 *v = val;
28739 }
28740 Ok(__struct)
28741 }
28742 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28743 let mut __tmp = BytesMut::new(bytes);
28744 #[allow(clippy::absurd_extreme_comparisons)]
28745 #[allow(unused_comparisons)]
28746 if __tmp.remaining() < Self::ENCODED_LEN {
28747 panic!(
28748 "buffer is too small (need {} bytes, but got {})",
28749 Self::ENCODED_LEN,
28750 __tmp.remaining(),
28751 )
28752 }
28753 __tmp.put_i32_le(self.capacity_full_specification);
28754 __tmp.put_i32_le(self.capacity_full);
28755 __tmp.put_u16_le(self.cycle_count);
28756 __tmp.put_u16_le(self.weight);
28757 __tmp.put_u16_le(self.discharge_minimum_voltage);
28758 __tmp.put_u16_le(self.charging_minimum_voltage);
28759 __tmp.put_u16_le(self.resting_minimum_voltage);
28760 __tmp.put_u8(self.id);
28761 __tmp.put_u8(self.battery_function as u8);
28762 __tmp.put_u8(self.mavtype as u8);
28763 for val in &self.serial_number {
28764 __tmp.put_u8(*val);
28765 }
28766 for val in &self.device_name {
28767 __tmp.put_u8(*val);
28768 }
28769 __tmp.put_u16_le(self.charging_maximum_voltage);
28770 __tmp.put_u8(self.cells_in_series);
28771 __tmp.put_u32_le(self.discharge_maximum_current);
28772 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28773 for val in &self.manufacture_date {
28774 __tmp.put_u8(*val);
28775 }
28776 if matches!(version, MavlinkVersion::V2) {
28777 let len = __tmp.len();
28778 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28779 } else {
28780 __tmp.len()
28781 }
28782 }
28783}
28784#[doc = "id: 253"]
28785#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28786#[derive(Debug, Clone, PartialEq)]
28787#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28788#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28789pub struct STATUSTEXT_DATA {
28790 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28791 pub severity: MavSeverity,
28792 #[doc = "Status text message, without null termination character"]
28793 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28794 pub text: [u8; 50],
28795 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28796 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28797 pub id: u16,
28798 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28799 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28800 pub chunk_seq: u8,
28801}
28802impl STATUSTEXT_DATA {
28803 pub const ENCODED_LEN: usize = 54usize;
28804 pub const DEFAULT: Self = Self {
28805 severity: MavSeverity::DEFAULT,
28806 text: [0_u8; 50usize],
28807 id: 0_u16,
28808 chunk_seq: 0_u8,
28809 };
28810 #[cfg(feature = "arbitrary")]
28811 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28812 use arbitrary::{Arbitrary, Unstructured};
28813 let mut buf = [0u8; 1024];
28814 rng.fill_bytes(&mut buf);
28815 let mut unstructured = Unstructured::new(&buf);
28816 Self::arbitrary(&mut unstructured).unwrap_or_default()
28817 }
28818}
28819impl Default for STATUSTEXT_DATA {
28820 fn default() -> Self {
28821 Self::DEFAULT.clone()
28822 }
28823}
28824impl MessageData for STATUSTEXT_DATA {
28825 type Message = MavMessage;
28826 const ID: u32 = 253u32;
28827 const NAME: &'static str = "STATUSTEXT";
28828 const EXTRA_CRC: u8 = 83u8;
28829 const ENCODED_LEN: usize = 54usize;
28830 fn deser(
28831 _version: MavlinkVersion,
28832 __input: &[u8],
28833 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28834 let avail_len = __input.len();
28835 let mut payload_buf = [0; Self::ENCODED_LEN];
28836 let mut buf = if avail_len < Self::ENCODED_LEN {
28837 payload_buf[0..avail_len].copy_from_slice(__input);
28838 Bytes::new(&payload_buf)
28839 } else {
28840 Bytes::new(__input)
28841 };
28842 let mut __struct = Self::default();
28843 let tmp = buf.get_u8();
28844 __struct.severity =
28845 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28846 enum_type: "MavSeverity",
28847 value: tmp as u32,
28848 })?;
28849 for v in &mut __struct.text {
28850 let val = buf.get_u8();
28851 *v = val;
28852 }
28853 __struct.id = buf.get_u16_le();
28854 __struct.chunk_seq = buf.get_u8();
28855 Ok(__struct)
28856 }
28857 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28858 let mut __tmp = BytesMut::new(bytes);
28859 #[allow(clippy::absurd_extreme_comparisons)]
28860 #[allow(unused_comparisons)]
28861 if __tmp.remaining() < Self::ENCODED_LEN {
28862 panic!(
28863 "buffer is too small (need {} bytes, but got {})",
28864 Self::ENCODED_LEN,
28865 __tmp.remaining(),
28866 )
28867 }
28868 __tmp.put_u8(self.severity as u8);
28869 for val in &self.text {
28870 __tmp.put_u8(*val);
28871 }
28872 __tmp.put_u16_le(self.id);
28873 __tmp.put_u8(self.chunk_seq);
28874 if matches!(version, MavlinkVersion::V2) {
28875 let len = __tmp.len();
28876 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28877 } else {
28878 __tmp.len()
28879 }
28880 }
28881}
28882#[doc = "id: 261"]
28883#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
28884#[derive(Debug, Clone, PartialEq)]
28885#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28886#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28887pub struct STORAGE_INFORMATION_DATA {
28888 #[doc = "Timestamp (time since system boot)."]
28889 pub time_boot_ms: u32,
28890 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28891 pub total_capacity: f32,
28892 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28893 pub used_capacity: f32,
28894 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28895 pub available_capacity: f32,
28896 #[doc = "Read speed."]
28897 pub read_speed: f32,
28898 #[doc = "Write speed."]
28899 pub write_speed: f32,
28900 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
28901 pub storage_id: u8,
28902 #[doc = "Number of storage devices"]
28903 pub storage_count: u8,
28904 #[doc = "Status of storage"]
28905 pub status: StorageStatus,
28906 #[doc = "Type of storage"]
28907 #[cfg_attr(feature = "serde", serde(default))]
28908 pub mavtype: StorageType,
28909 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
28910 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28911 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28912 pub name: [u8; 32],
28913 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
28914 #[cfg_attr(feature = "serde", serde(default))]
28915 pub storage_usage: StorageUsageFlag,
28916}
28917impl STORAGE_INFORMATION_DATA {
28918 pub const ENCODED_LEN: usize = 61usize;
28919 pub const DEFAULT: Self = Self {
28920 time_boot_ms: 0_u32,
28921 total_capacity: 0.0_f32,
28922 used_capacity: 0.0_f32,
28923 available_capacity: 0.0_f32,
28924 read_speed: 0.0_f32,
28925 write_speed: 0.0_f32,
28926 storage_id: 0_u8,
28927 storage_count: 0_u8,
28928 status: StorageStatus::DEFAULT,
28929 mavtype: StorageType::DEFAULT,
28930 name: [0_u8; 32usize],
28931 storage_usage: StorageUsageFlag::DEFAULT,
28932 };
28933 #[cfg(feature = "arbitrary")]
28934 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28935 use arbitrary::{Arbitrary, Unstructured};
28936 let mut buf = [0u8; 1024];
28937 rng.fill_bytes(&mut buf);
28938 let mut unstructured = Unstructured::new(&buf);
28939 Self::arbitrary(&mut unstructured).unwrap_or_default()
28940 }
28941}
28942impl Default for STORAGE_INFORMATION_DATA {
28943 fn default() -> Self {
28944 Self::DEFAULT.clone()
28945 }
28946}
28947impl MessageData for STORAGE_INFORMATION_DATA {
28948 type Message = MavMessage;
28949 const ID: u32 = 261u32;
28950 const NAME: &'static str = "STORAGE_INFORMATION";
28951 const EXTRA_CRC: u8 = 179u8;
28952 const ENCODED_LEN: usize = 61usize;
28953 fn deser(
28954 _version: MavlinkVersion,
28955 __input: &[u8],
28956 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28957 let avail_len = __input.len();
28958 let mut payload_buf = [0; Self::ENCODED_LEN];
28959 let mut buf = if avail_len < Self::ENCODED_LEN {
28960 payload_buf[0..avail_len].copy_from_slice(__input);
28961 Bytes::new(&payload_buf)
28962 } else {
28963 Bytes::new(__input)
28964 };
28965 let mut __struct = Self::default();
28966 __struct.time_boot_ms = buf.get_u32_le();
28967 __struct.total_capacity = buf.get_f32_le();
28968 __struct.used_capacity = buf.get_f32_le();
28969 __struct.available_capacity = buf.get_f32_le();
28970 __struct.read_speed = buf.get_f32_le();
28971 __struct.write_speed = buf.get_f32_le();
28972 __struct.storage_id = buf.get_u8();
28973 __struct.storage_count = buf.get_u8();
28974 let tmp = buf.get_u8();
28975 __struct.status =
28976 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28977 enum_type: "StorageStatus",
28978 value: tmp as u32,
28979 })?;
28980 let tmp = buf.get_u8();
28981 __struct.mavtype =
28982 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28983 enum_type: "StorageType",
28984 value: tmp as u32,
28985 })?;
28986 for v in &mut __struct.name {
28987 let val = buf.get_u8();
28988 *v = val;
28989 }
28990 let tmp = buf.get_u8();
28991 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
28992 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28993 flag_type: "StorageUsageFlag",
28994 value: tmp as u32,
28995 })?;
28996 Ok(__struct)
28997 }
28998 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28999 let mut __tmp = BytesMut::new(bytes);
29000 #[allow(clippy::absurd_extreme_comparisons)]
29001 #[allow(unused_comparisons)]
29002 if __tmp.remaining() < Self::ENCODED_LEN {
29003 panic!(
29004 "buffer is too small (need {} bytes, but got {})",
29005 Self::ENCODED_LEN,
29006 __tmp.remaining(),
29007 )
29008 }
29009 __tmp.put_u32_le(self.time_boot_ms);
29010 __tmp.put_f32_le(self.total_capacity);
29011 __tmp.put_f32_le(self.used_capacity);
29012 __tmp.put_f32_le(self.available_capacity);
29013 __tmp.put_f32_le(self.read_speed);
29014 __tmp.put_f32_le(self.write_speed);
29015 __tmp.put_u8(self.storage_id);
29016 __tmp.put_u8(self.storage_count);
29017 __tmp.put_u8(self.status as u8);
29018 __tmp.put_u8(self.mavtype as u8);
29019 for val in &self.name {
29020 __tmp.put_u8(*val);
29021 }
29022 __tmp.put_u8(self.storage_usage.bits());
29023 if matches!(version, MavlinkVersion::V2) {
29024 let len = __tmp.len();
29025 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29026 } else {
29027 __tmp.len()
29028 }
29029 }
29030}
29031#[doc = "id: 401"]
29032#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
29033#[derive(Debug, Clone, PartialEq)]
29034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29036pub struct SUPPORTED_TUNES_DATA {
29037 #[doc = "Bitfield of supported tune formats."]
29038 pub format: TuneFormat,
29039 #[doc = "System ID"]
29040 pub target_system: u8,
29041 #[doc = "Component ID"]
29042 pub target_component: u8,
29043}
29044impl SUPPORTED_TUNES_DATA {
29045 pub const ENCODED_LEN: usize = 6usize;
29046 pub const DEFAULT: Self = Self {
29047 format: TuneFormat::DEFAULT,
29048 target_system: 0_u8,
29049 target_component: 0_u8,
29050 };
29051 #[cfg(feature = "arbitrary")]
29052 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29053 use arbitrary::{Arbitrary, Unstructured};
29054 let mut buf = [0u8; 1024];
29055 rng.fill_bytes(&mut buf);
29056 let mut unstructured = Unstructured::new(&buf);
29057 Self::arbitrary(&mut unstructured).unwrap_or_default()
29058 }
29059}
29060impl Default for SUPPORTED_TUNES_DATA {
29061 fn default() -> Self {
29062 Self::DEFAULT.clone()
29063 }
29064}
29065impl MessageData for SUPPORTED_TUNES_DATA {
29066 type Message = MavMessage;
29067 const ID: u32 = 401u32;
29068 const NAME: &'static str = "SUPPORTED_TUNES";
29069 const EXTRA_CRC: u8 = 183u8;
29070 const ENCODED_LEN: usize = 6usize;
29071 fn deser(
29072 _version: MavlinkVersion,
29073 __input: &[u8],
29074 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29075 let avail_len = __input.len();
29076 let mut payload_buf = [0; Self::ENCODED_LEN];
29077 let mut buf = if avail_len < Self::ENCODED_LEN {
29078 payload_buf[0..avail_len].copy_from_slice(__input);
29079 Bytes::new(&payload_buf)
29080 } else {
29081 Bytes::new(__input)
29082 };
29083 let mut __struct = Self::default();
29084 let tmp = buf.get_u32_le();
29085 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
29086 ::mavlink_core::error::ParserError::InvalidEnum {
29087 enum_type: "TuneFormat",
29088 value: tmp as u32,
29089 },
29090 )?;
29091 __struct.target_system = buf.get_u8();
29092 __struct.target_component = buf.get_u8();
29093 Ok(__struct)
29094 }
29095 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29096 let mut __tmp = BytesMut::new(bytes);
29097 #[allow(clippy::absurd_extreme_comparisons)]
29098 #[allow(unused_comparisons)]
29099 if __tmp.remaining() < Self::ENCODED_LEN {
29100 panic!(
29101 "buffer is too small (need {} bytes, but got {})",
29102 Self::ENCODED_LEN,
29103 __tmp.remaining(),
29104 )
29105 }
29106 __tmp.put_u32_le(self.format as u32);
29107 __tmp.put_u8(self.target_system);
29108 __tmp.put_u8(self.target_component);
29109 if matches!(version, MavlinkVersion::V2) {
29110 let len = __tmp.len();
29111 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29112 } else {
29113 __tmp.len()
29114 }
29115 }
29116}
29117#[doc = "id: 2"]
29118#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29119#[derive(Debug, Clone, PartialEq)]
29120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29121#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29122pub struct SYSTEM_TIME_DATA {
29123 #[doc = "Timestamp (UNIX epoch time)."]
29124 pub time_unix_usec: u64,
29125 #[doc = "Timestamp (time since system boot)."]
29126 pub time_boot_ms: u32,
29127}
29128impl SYSTEM_TIME_DATA {
29129 pub const ENCODED_LEN: usize = 12usize;
29130 pub const DEFAULT: Self = Self {
29131 time_unix_usec: 0_u64,
29132 time_boot_ms: 0_u32,
29133 };
29134 #[cfg(feature = "arbitrary")]
29135 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29136 use arbitrary::{Arbitrary, Unstructured};
29137 let mut buf = [0u8; 1024];
29138 rng.fill_bytes(&mut buf);
29139 let mut unstructured = Unstructured::new(&buf);
29140 Self::arbitrary(&mut unstructured).unwrap_or_default()
29141 }
29142}
29143impl Default for SYSTEM_TIME_DATA {
29144 fn default() -> Self {
29145 Self::DEFAULT.clone()
29146 }
29147}
29148impl MessageData for SYSTEM_TIME_DATA {
29149 type Message = MavMessage;
29150 const ID: u32 = 2u32;
29151 const NAME: &'static str = "SYSTEM_TIME";
29152 const EXTRA_CRC: u8 = 137u8;
29153 const ENCODED_LEN: usize = 12usize;
29154 fn deser(
29155 _version: MavlinkVersion,
29156 __input: &[u8],
29157 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29158 let avail_len = __input.len();
29159 let mut payload_buf = [0; Self::ENCODED_LEN];
29160 let mut buf = if avail_len < Self::ENCODED_LEN {
29161 payload_buf[0..avail_len].copy_from_slice(__input);
29162 Bytes::new(&payload_buf)
29163 } else {
29164 Bytes::new(__input)
29165 };
29166 let mut __struct = Self::default();
29167 __struct.time_unix_usec = buf.get_u64_le();
29168 __struct.time_boot_ms = buf.get_u32_le();
29169 Ok(__struct)
29170 }
29171 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29172 let mut __tmp = BytesMut::new(bytes);
29173 #[allow(clippy::absurd_extreme_comparisons)]
29174 #[allow(unused_comparisons)]
29175 if __tmp.remaining() < Self::ENCODED_LEN {
29176 panic!(
29177 "buffer is too small (need {} bytes, but got {})",
29178 Self::ENCODED_LEN,
29179 __tmp.remaining(),
29180 )
29181 }
29182 __tmp.put_u64_le(self.time_unix_usec);
29183 __tmp.put_u32_le(self.time_boot_ms);
29184 if matches!(version, MavlinkVersion::V2) {
29185 let len = __tmp.len();
29186 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29187 } else {
29188 __tmp.len()
29189 }
29190 }
29191}
29192#[doc = "id: 1"]
29193#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
29194#[derive(Debug, Clone, PartialEq)]
29195#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29196#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29197pub struct SYS_STATUS_DATA {
29198 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29199 pub onboard_control_sensors_present: MavSysStatusSensor,
29200 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29201 pub onboard_control_sensors_enabled: MavSysStatusSensor,
29202 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29203 pub onboard_control_sensors_health: MavSysStatusSensor,
29204 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
29205 pub load: u16,
29206 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
29207 pub voltage_battery: u16,
29208 #[doc = "Battery current, -1: Current not sent by autopilot"]
29209 pub current_battery: i16,
29210 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29211 pub drop_rate_comm: u16,
29212 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29213 pub errors_comm: u16,
29214 #[doc = "Autopilot-specific errors"]
29215 pub errors_count1: u16,
29216 #[doc = "Autopilot-specific errors"]
29217 pub errors_count2: u16,
29218 #[doc = "Autopilot-specific errors"]
29219 pub errors_count3: u16,
29220 #[doc = "Autopilot-specific errors"]
29221 pub errors_count4: u16,
29222 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
29223 pub battery_remaining: i8,
29224 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29225 #[cfg_attr(feature = "serde", serde(default))]
29226 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
29227 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29228 #[cfg_attr(feature = "serde", serde(default))]
29229 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
29230 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29231 #[cfg_attr(feature = "serde", serde(default))]
29232 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
29233}
29234impl SYS_STATUS_DATA {
29235 pub const ENCODED_LEN: usize = 43usize;
29236 pub const DEFAULT: Self = Self {
29237 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
29238 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
29239 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
29240 load: 0_u16,
29241 voltage_battery: 0_u16,
29242 current_battery: 0_i16,
29243 drop_rate_comm: 0_u16,
29244 errors_comm: 0_u16,
29245 errors_count1: 0_u16,
29246 errors_count2: 0_u16,
29247 errors_count3: 0_u16,
29248 errors_count4: 0_u16,
29249 battery_remaining: 0_i8,
29250 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
29251 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
29252 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
29253 };
29254 #[cfg(feature = "arbitrary")]
29255 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29256 use arbitrary::{Arbitrary, Unstructured};
29257 let mut buf = [0u8; 1024];
29258 rng.fill_bytes(&mut buf);
29259 let mut unstructured = Unstructured::new(&buf);
29260 Self::arbitrary(&mut unstructured).unwrap_or_default()
29261 }
29262}
29263impl Default for SYS_STATUS_DATA {
29264 fn default() -> Self {
29265 Self::DEFAULT.clone()
29266 }
29267}
29268impl MessageData for SYS_STATUS_DATA {
29269 type Message = MavMessage;
29270 const ID: u32 = 1u32;
29271 const NAME: &'static str = "SYS_STATUS";
29272 const EXTRA_CRC: u8 = 124u8;
29273 const ENCODED_LEN: usize = 43usize;
29274 fn deser(
29275 _version: MavlinkVersion,
29276 __input: &[u8],
29277 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29278 let avail_len = __input.len();
29279 let mut payload_buf = [0; Self::ENCODED_LEN];
29280 let mut buf = if avail_len < Self::ENCODED_LEN {
29281 payload_buf[0..avail_len].copy_from_slice(__input);
29282 Bytes::new(&payload_buf)
29283 } else {
29284 Bytes::new(__input)
29285 };
29286 let mut __struct = Self::default();
29287 let tmp = buf.get_u32_le();
29288 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
29289 tmp & MavSysStatusSensor::all().bits(),
29290 )
29291 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29292 flag_type: "MavSysStatusSensor",
29293 value: tmp as u32,
29294 })?;
29295 let tmp = buf.get_u32_le();
29296 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
29297 tmp & MavSysStatusSensor::all().bits(),
29298 )
29299 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29300 flag_type: "MavSysStatusSensor",
29301 value: tmp as u32,
29302 })?;
29303 let tmp = buf.get_u32_le();
29304 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
29305 tmp & MavSysStatusSensor::all().bits(),
29306 )
29307 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29308 flag_type: "MavSysStatusSensor",
29309 value: tmp as u32,
29310 })?;
29311 __struct.load = buf.get_u16_le();
29312 __struct.voltage_battery = buf.get_u16_le();
29313 __struct.current_battery = buf.get_i16_le();
29314 __struct.drop_rate_comm = buf.get_u16_le();
29315 __struct.errors_comm = buf.get_u16_le();
29316 __struct.errors_count1 = buf.get_u16_le();
29317 __struct.errors_count2 = buf.get_u16_le();
29318 __struct.errors_count3 = buf.get_u16_le();
29319 __struct.errors_count4 = buf.get_u16_le();
29320 __struct.battery_remaining = buf.get_i8();
29321 let tmp = buf.get_u32_le();
29322 __struct.onboard_control_sensors_present_extended =
29323 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29324 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29325 flag_type: "MavSysStatusSensorExtended",
29326 value: tmp as u32,
29327 })?;
29328 let tmp = buf.get_u32_le();
29329 __struct.onboard_control_sensors_enabled_extended =
29330 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29331 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29332 flag_type: "MavSysStatusSensorExtended",
29333 value: tmp as u32,
29334 })?;
29335 let tmp = buf.get_u32_le();
29336 __struct.onboard_control_sensors_health_extended =
29337 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29338 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29339 flag_type: "MavSysStatusSensorExtended",
29340 value: tmp as u32,
29341 })?;
29342 Ok(__struct)
29343 }
29344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29345 let mut __tmp = BytesMut::new(bytes);
29346 #[allow(clippy::absurd_extreme_comparisons)]
29347 #[allow(unused_comparisons)]
29348 if __tmp.remaining() < Self::ENCODED_LEN {
29349 panic!(
29350 "buffer is too small (need {} bytes, but got {})",
29351 Self::ENCODED_LEN,
29352 __tmp.remaining(),
29353 )
29354 }
29355 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
29356 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
29357 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
29358 __tmp.put_u16_le(self.load);
29359 __tmp.put_u16_le(self.voltage_battery);
29360 __tmp.put_i16_le(self.current_battery);
29361 __tmp.put_u16_le(self.drop_rate_comm);
29362 __tmp.put_u16_le(self.errors_comm);
29363 __tmp.put_u16_le(self.errors_count1);
29364 __tmp.put_u16_le(self.errors_count2);
29365 __tmp.put_u16_le(self.errors_count3);
29366 __tmp.put_u16_le(self.errors_count4);
29367 __tmp.put_i8(self.battery_remaining);
29368 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
29369 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
29370 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
29371 if matches!(version, MavlinkVersion::V2) {
29372 let len = __tmp.len();
29373 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29374 } else {
29375 __tmp.len()
29376 }
29377 }
29378}
29379#[doc = "id: 510"]
29380#[doc = "Current motion information from sensors on a target."]
29381#[derive(Debug, Clone, PartialEq)]
29382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29384pub struct TARGET_ABSOLUTE_DATA {
29385 #[doc = "Timestamp (UNIX epoch time)."]
29386 pub timestamp: u64,
29387 #[doc = "Target's latitude (WGS84)"]
29388 pub lat: i32,
29389 #[doc = "Target's longitude (WGS84)"]
29390 pub lon: i32,
29391 #[doc = "Target's altitude (AMSL)"]
29392 pub alt: f32,
29393 #[doc = "Target's velocity in its body frame"]
29394 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29395 pub vel: [f32; 3],
29396 #[doc = "Linear target's acceleration in its body frame"]
29397 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29398 pub acc: [f32; 3],
29399 #[doc = "Quaternion of the target's orientation from its body frame to the vehicle's NED frame."]
29400 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29401 pub q_target: [f32; 4],
29402 #[doc = "Target's roll, pitch and yaw rates"]
29403 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29404 pub rates: [f32; 3],
29405 #[doc = "Standard deviation of horizontal (eph) and vertical (epv) position errors"]
29406 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29407 pub position_std: [f32; 2],
29408 #[doc = "Standard deviation of the target's velocity in its body frame"]
29409 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29410 pub vel_std: [f32; 3],
29411 #[doc = "Standard deviation of the target's acceleration in its body frame"]
29412 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29413 pub acc_std: [f32; 3],
29414 #[doc = "The ID of the target if multiple targets are present"]
29415 pub id: u8,
29416 #[doc = "Bitmap to indicate the sensor's reporting capabilities"]
29417 pub sensor_capabilities: TargetAbsoluteSensorCapabilityFlags,
29418}
29419impl TARGET_ABSOLUTE_DATA {
29420 pub const ENCODED_LEN: usize = 106usize;
29421 pub const DEFAULT: Self = Self {
29422 timestamp: 0_u64,
29423 lat: 0_i32,
29424 lon: 0_i32,
29425 alt: 0.0_f32,
29426 vel: [0.0_f32; 3usize],
29427 acc: [0.0_f32; 3usize],
29428 q_target: [0.0_f32; 4usize],
29429 rates: [0.0_f32; 3usize],
29430 position_std: [0.0_f32; 2usize],
29431 vel_std: [0.0_f32; 3usize],
29432 acc_std: [0.0_f32; 3usize],
29433 id: 0_u8,
29434 sensor_capabilities: TargetAbsoluteSensorCapabilityFlags::DEFAULT,
29435 };
29436 #[cfg(feature = "arbitrary")]
29437 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29438 use arbitrary::{Arbitrary, Unstructured};
29439 let mut buf = [0u8; 1024];
29440 rng.fill_bytes(&mut buf);
29441 let mut unstructured = Unstructured::new(&buf);
29442 Self::arbitrary(&mut unstructured).unwrap_or_default()
29443 }
29444}
29445impl Default for TARGET_ABSOLUTE_DATA {
29446 fn default() -> Self {
29447 Self::DEFAULT.clone()
29448 }
29449}
29450impl MessageData for TARGET_ABSOLUTE_DATA {
29451 type Message = MavMessage;
29452 const ID: u32 = 510u32;
29453 const NAME: &'static str = "TARGET_ABSOLUTE";
29454 const EXTRA_CRC: u8 = 245u8;
29455 const ENCODED_LEN: usize = 106usize;
29456 fn deser(
29457 _version: MavlinkVersion,
29458 __input: &[u8],
29459 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29460 let avail_len = __input.len();
29461 let mut payload_buf = [0; Self::ENCODED_LEN];
29462 let mut buf = if avail_len < Self::ENCODED_LEN {
29463 payload_buf[0..avail_len].copy_from_slice(__input);
29464 Bytes::new(&payload_buf)
29465 } else {
29466 Bytes::new(__input)
29467 };
29468 let mut __struct = Self::default();
29469 __struct.timestamp = buf.get_u64_le();
29470 __struct.lat = buf.get_i32_le();
29471 __struct.lon = buf.get_i32_le();
29472 __struct.alt = buf.get_f32_le();
29473 for v in &mut __struct.vel {
29474 let val = buf.get_f32_le();
29475 *v = val;
29476 }
29477 for v in &mut __struct.acc {
29478 let val = buf.get_f32_le();
29479 *v = val;
29480 }
29481 for v in &mut __struct.q_target {
29482 let val = buf.get_f32_le();
29483 *v = val;
29484 }
29485 for v in &mut __struct.rates {
29486 let val = buf.get_f32_le();
29487 *v = val;
29488 }
29489 for v in &mut __struct.position_std {
29490 let val = buf.get_f32_le();
29491 *v = val;
29492 }
29493 for v in &mut __struct.vel_std {
29494 let val = buf.get_f32_le();
29495 *v = val;
29496 }
29497 for v in &mut __struct.acc_std {
29498 let val = buf.get_f32_le();
29499 *v = val;
29500 }
29501 __struct.id = buf.get_u8();
29502 let tmp = buf.get_u8();
29503 __struct.sensor_capabilities = TargetAbsoluteSensorCapabilityFlags::from_bits(
29504 tmp & TargetAbsoluteSensorCapabilityFlags::all().bits(),
29505 )
29506 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29507 flag_type: "TargetAbsoluteSensorCapabilityFlags",
29508 value: tmp as u32,
29509 })?;
29510 Ok(__struct)
29511 }
29512 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29513 let mut __tmp = BytesMut::new(bytes);
29514 #[allow(clippy::absurd_extreme_comparisons)]
29515 #[allow(unused_comparisons)]
29516 if __tmp.remaining() < Self::ENCODED_LEN {
29517 panic!(
29518 "buffer is too small (need {} bytes, but got {})",
29519 Self::ENCODED_LEN,
29520 __tmp.remaining(),
29521 )
29522 }
29523 __tmp.put_u64_le(self.timestamp);
29524 __tmp.put_i32_le(self.lat);
29525 __tmp.put_i32_le(self.lon);
29526 __tmp.put_f32_le(self.alt);
29527 for val in &self.vel {
29528 __tmp.put_f32_le(*val);
29529 }
29530 for val in &self.acc {
29531 __tmp.put_f32_le(*val);
29532 }
29533 for val in &self.q_target {
29534 __tmp.put_f32_le(*val);
29535 }
29536 for val in &self.rates {
29537 __tmp.put_f32_le(*val);
29538 }
29539 for val in &self.position_std {
29540 __tmp.put_f32_le(*val);
29541 }
29542 for val in &self.vel_std {
29543 __tmp.put_f32_le(*val);
29544 }
29545 for val in &self.acc_std {
29546 __tmp.put_f32_le(*val);
29547 }
29548 __tmp.put_u8(self.id);
29549 __tmp.put_u8(self.sensor_capabilities.bits());
29550 if matches!(version, MavlinkVersion::V2) {
29551 let len = __tmp.len();
29552 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29553 } else {
29554 __tmp.len()
29555 }
29556 }
29557}
29558#[doc = "id: 511"]
29559#[doc = "The location of a target measured by MAV's onboard sensors."]
29560#[derive(Debug, Clone, PartialEq)]
29561#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29563pub struct TARGET_RELATIVE_DATA {
29564 #[doc = "Timestamp (UNIX epoch time)"]
29565 pub timestamp: u64,
29566 #[doc = "X Position of the target in TARGET_OBS_FRAME"]
29567 pub x: f32,
29568 #[doc = "Y Position of the target in TARGET_OBS_FRAME"]
29569 pub y: f32,
29570 #[doc = "Z Position of the target in TARGET_OBS_FRAME"]
29571 pub z: f32,
29572 #[doc = "Standard deviation of the target's position in TARGET_OBS_FRAME"]
29573 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29574 pub pos_std: [f32; 3],
29575 #[doc = "Standard deviation of the target's orientation in TARGET_OBS_FRAME"]
29576 pub yaw_std: f32,
29577 #[doc = "Quaternion of the target's orientation from the target's frame to the TARGET_OBS_FRAME (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
29578 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29579 pub q_target: [f32; 4],
29580 #[doc = "Quaternion of the sensor's orientation from TARGET_OBS_FRAME to vehicle-carried NED. (Ignored if set to (0,0,0,0)) (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
29581 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29582 pub q_sensor: [f32; 4],
29583 #[doc = "The ID of the target if multiple targets are present"]
29584 pub id: u8,
29585 #[doc = "Coordinate frame used for following fields."]
29586 pub frame: TargetObsFrame,
29587 #[doc = "Type of target"]
29588 pub mavtype: LandingTargetType,
29589}
29590impl TARGET_RELATIVE_DATA {
29591 pub const ENCODED_LEN: usize = 71usize;
29592 pub const DEFAULT: Self = Self {
29593 timestamp: 0_u64,
29594 x: 0.0_f32,
29595 y: 0.0_f32,
29596 z: 0.0_f32,
29597 pos_std: [0.0_f32; 3usize],
29598 yaw_std: 0.0_f32,
29599 q_target: [0.0_f32; 4usize],
29600 q_sensor: [0.0_f32; 4usize],
29601 id: 0_u8,
29602 frame: TargetObsFrame::DEFAULT,
29603 mavtype: LandingTargetType::DEFAULT,
29604 };
29605 #[cfg(feature = "arbitrary")]
29606 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29607 use arbitrary::{Arbitrary, Unstructured};
29608 let mut buf = [0u8; 1024];
29609 rng.fill_bytes(&mut buf);
29610 let mut unstructured = Unstructured::new(&buf);
29611 Self::arbitrary(&mut unstructured).unwrap_or_default()
29612 }
29613}
29614impl Default for TARGET_RELATIVE_DATA {
29615 fn default() -> Self {
29616 Self::DEFAULT.clone()
29617 }
29618}
29619impl MessageData for TARGET_RELATIVE_DATA {
29620 type Message = MavMessage;
29621 const ID: u32 = 511u32;
29622 const NAME: &'static str = "TARGET_RELATIVE";
29623 const EXTRA_CRC: u8 = 28u8;
29624 const ENCODED_LEN: usize = 71usize;
29625 fn deser(
29626 _version: MavlinkVersion,
29627 __input: &[u8],
29628 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29629 let avail_len = __input.len();
29630 let mut payload_buf = [0; Self::ENCODED_LEN];
29631 let mut buf = if avail_len < Self::ENCODED_LEN {
29632 payload_buf[0..avail_len].copy_from_slice(__input);
29633 Bytes::new(&payload_buf)
29634 } else {
29635 Bytes::new(__input)
29636 };
29637 let mut __struct = Self::default();
29638 __struct.timestamp = buf.get_u64_le();
29639 __struct.x = buf.get_f32_le();
29640 __struct.y = buf.get_f32_le();
29641 __struct.z = buf.get_f32_le();
29642 for v in &mut __struct.pos_std {
29643 let val = buf.get_f32_le();
29644 *v = val;
29645 }
29646 __struct.yaw_std = buf.get_f32_le();
29647 for v in &mut __struct.q_target {
29648 let val = buf.get_f32_le();
29649 *v = val;
29650 }
29651 for v in &mut __struct.q_sensor {
29652 let val = buf.get_f32_le();
29653 *v = val;
29654 }
29655 __struct.id = buf.get_u8();
29656 let tmp = buf.get_u8();
29657 __struct.frame =
29658 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29659 enum_type: "TargetObsFrame",
29660 value: tmp as u32,
29661 })?;
29662 let tmp = buf.get_u8();
29663 __struct.mavtype =
29664 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29665 enum_type: "LandingTargetType",
29666 value: tmp as u32,
29667 })?;
29668 Ok(__struct)
29669 }
29670 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29671 let mut __tmp = BytesMut::new(bytes);
29672 #[allow(clippy::absurd_extreme_comparisons)]
29673 #[allow(unused_comparisons)]
29674 if __tmp.remaining() < Self::ENCODED_LEN {
29675 panic!(
29676 "buffer is too small (need {} bytes, but got {})",
29677 Self::ENCODED_LEN,
29678 __tmp.remaining(),
29679 )
29680 }
29681 __tmp.put_u64_le(self.timestamp);
29682 __tmp.put_f32_le(self.x);
29683 __tmp.put_f32_le(self.y);
29684 __tmp.put_f32_le(self.z);
29685 for val in &self.pos_std {
29686 __tmp.put_f32_le(*val);
29687 }
29688 __tmp.put_f32_le(self.yaw_std);
29689 for val in &self.q_target {
29690 __tmp.put_f32_le(*val);
29691 }
29692 for val in &self.q_sensor {
29693 __tmp.put_f32_le(*val);
29694 }
29695 __tmp.put_u8(self.id);
29696 __tmp.put_u8(self.frame as u8);
29697 __tmp.put_u8(self.mavtype as u8);
29698 if matches!(version, MavlinkVersion::V2) {
29699 let len = __tmp.len();
29700 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29701 } else {
29702 __tmp.len()
29703 }
29704 }
29705}
29706#[doc = "id: 135"]
29707#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
29708#[derive(Debug, Clone, PartialEq)]
29709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29711pub struct TERRAIN_CHECK_DATA {
29712 #[doc = "Latitude"]
29713 pub lat: i32,
29714 #[doc = "Longitude"]
29715 pub lon: i32,
29716}
29717impl TERRAIN_CHECK_DATA {
29718 pub const ENCODED_LEN: usize = 8usize;
29719 pub const DEFAULT: Self = Self {
29720 lat: 0_i32,
29721 lon: 0_i32,
29722 };
29723 #[cfg(feature = "arbitrary")]
29724 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29725 use arbitrary::{Arbitrary, Unstructured};
29726 let mut buf = [0u8; 1024];
29727 rng.fill_bytes(&mut buf);
29728 let mut unstructured = Unstructured::new(&buf);
29729 Self::arbitrary(&mut unstructured).unwrap_or_default()
29730 }
29731}
29732impl Default for TERRAIN_CHECK_DATA {
29733 fn default() -> Self {
29734 Self::DEFAULT.clone()
29735 }
29736}
29737impl MessageData for TERRAIN_CHECK_DATA {
29738 type Message = MavMessage;
29739 const ID: u32 = 135u32;
29740 const NAME: &'static str = "TERRAIN_CHECK";
29741 const EXTRA_CRC: u8 = 203u8;
29742 const ENCODED_LEN: usize = 8usize;
29743 fn deser(
29744 _version: MavlinkVersion,
29745 __input: &[u8],
29746 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29747 let avail_len = __input.len();
29748 let mut payload_buf = [0; Self::ENCODED_LEN];
29749 let mut buf = if avail_len < Self::ENCODED_LEN {
29750 payload_buf[0..avail_len].copy_from_slice(__input);
29751 Bytes::new(&payload_buf)
29752 } else {
29753 Bytes::new(__input)
29754 };
29755 let mut __struct = Self::default();
29756 __struct.lat = buf.get_i32_le();
29757 __struct.lon = buf.get_i32_le();
29758 Ok(__struct)
29759 }
29760 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29761 let mut __tmp = BytesMut::new(bytes);
29762 #[allow(clippy::absurd_extreme_comparisons)]
29763 #[allow(unused_comparisons)]
29764 if __tmp.remaining() < Self::ENCODED_LEN {
29765 panic!(
29766 "buffer is too small (need {} bytes, but got {})",
29767 Self::ENCODED_LEN,
29768 __tmp.remaining(),
29769 )
29770 }
29771 __tmp.put_i32_le(self.lat);
29772 __tmp.put_i32_le(self.lon);
29773 if matches!(version, MavlinkVersion::V2) {
29774 let len = __tmp.len();
29775 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29776 } else {
29777 __tmp.len()
29778 }
29779 }
29780}
29781#[doc = "id: 134"]
29782#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29783#[derive(Debug, Clone, PartialEq)]
29784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29785#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29786pub struct TERRAIN_DATA_DATA {
29787 #[doc = "Latitude of SW corner of first grid"]
29788 pub lat: i32,
29789 #[doc = "Longitude of SW corner of first grid"]
29790 pub lon: i32,
29791 #[doc = "Grid spacing"]
29792 pub grid_spacing: u16,
29793 #[doc = "Terrain data MSL"]
29794 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29795 pub data: [i16; 16],
29796 #[doc = "bit within the terrain request mask"]
29797 pub gridbit: u8,
29798}
29799impl TERRAIN_DATA_DATA {
29800 pub const ENCODED_LEN: usize = 43usize;
29801 pub const DEFAULT: Self = Self {
29802 lat: 0_i32,
29803 lon: 0_i32,
29804 grid_spacing: 0_u16,
29805 data: [0_i16; 16usize],
29806 gridbit: 0_u8,
29807 };
29808 #[cfg(feature = "arbitrary")]
29809 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29810 use arbitrary::{Arbitrary, Unstructured};
29811 let mut buf = [0u8; 1024];
29812 rng.fill_bytes(&mut buf);
29813 let mut unstructured = Unstructured::new(&buf);
29814 Self::arbitrary(&mut unstructured).unwrap_or_default()
29815 }
29816}
29817impl Default for TERRAIN_DATA_DATA {
29818 fn default() -> Self {
29819 Self::DEFAULT.clone()
29820 }
29821}
29822impl MessageData for TERRAIN_DATA_DATA {
29823 type Message = MavMessage;
29824 const ID: u32 = 134u32;
29825 const NAME: &'static str = "TERRAIN_DATA";
29826 const EXTRA_CRC: u8 = 229u8;
29827 const ENCODED_LEN: usize = 43usize;
29828 fn deser(
29829 _version: MavlinkVersion,
29830 __input: &[u8],
29831 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29832 let avail_len = __input.len();
29833 let mut payload_buf = [0; Self::ENCODED_LEN];
29834 let mut buf = if avail_len < Self::ENCODED_LEN {
29835 payload_buf[0..avail_len].copy_from_slice(__input);
29836 Bytes::new(&payload_buf)
29837 } else {
29838 Bytes::new(__input)
29839 };
29840 let mut __struct = Self::default();
29841 __struct.lat = buf.get_i32_le();
29842 __struct.lon = buf.get_i32_le();
29843 __struct.grid_spacing = buf.get_u16_le();
29844 for v in &mut __struct.data {
29845 let val = buf.get_i16_le();
29846 *v = val;
29847 }
29848 __struct.gridbit = buf.get_u8();
29849 Ok(__struct)
29850 }
29851 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29852 let mut __tmp = BytesMut::new(bytes);
29853 #[allow(clippy::absurd_extreme_comparisons)]
29854 #[allow(unused_comparisons)]
29855 if __tmp.remaining() < Self::ENCODED_LEN {
29856 panic!(
29857 "buffer is too small (need {} bytes, but got {})",
29858 Self::ENCODED_LEN,
29859 __tmp.remaining(),
29860 )
29861 }
29862 __tmp.put_i32_le(self.lat);
29863 __tmp.put_i32_le(self.lon);
29864 __tmp.put_u16_le(self.grid_spacing);
29865 for val in &self.data {
29866 __tmp.put_i16_le(*val);
29867 }
29868 __tmp.put_u8(self.gridbit);
29869 if matches!(version, MavlinkVersion::V2) {
29870 let len = __tmp.len();
29871 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29872 } else {
29873 __tmp.len()
29874 }
29875 }
29876}
29877#[doc = "id: 136"]
29878#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29879#[derive(Debug, Clone, PartialEq)]
29880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29882pub struct TERRAIN_REPORT_DATA {
29883 #[doc = "Latitude"]
29884 pub lat: i32,
29885 #[doc = "Longitude"]
29886 pub lon: i32,
29887 #[doc = "Terrain height MSL"]
29888 pub terrain_height: f32,
29889 #[doc = "Current vehicle height above lat/lon terrain height"]
29890 pub current_height: f32,
29891 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
29892 pub spacing: u16,
29893 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
29894 pub pending: u16,
29895 #[doc = "Number of 4x4 terrain blocks in memory"]
29896 pub loaded: u16,
29897}
29898impl TERRAIN_REPORT_DATA {
29899 pub const ENCODED_LEN: usize = 22usize;
29900 pub const DEFAULT: Self = Self {
29901 lat: 0_i32,
29902 lon: 0_i32,
29903 terrain_height: 0.0_f32,
29904 current_height: 0.0_f32,
29905 spacing: 0_u16,
29906 pending: 0_u16,
29907 loaded: 0_u16,
29908 };
29909 #[cfg(feature = "arbitrary")]
29910 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29911 use arbitrary::{Arbitrary, Unstructured};
29912 let mut buf = [0u8; 1024];
29913 rng.fill_bytes(&mut buf);
29914 let mut unstructured = Unstructured::new(&buf);
29915 Self::arbitrary(&mut unstructured).unwrap_or_default()
29916 }
29917}
29918impl Default for TERRAIN_REPORT_DATA {
29919 fn default() -> Self {
29920 Self::DEFAULT.clone()
29921 }
29922}
29923impl MessageData for TERRAIN_REPORT_DATA {
29924 type Message = MavMessage;
29925 const ID: u32 = 136u32;
29926 const NAME: &'static str = "TERRAIN_REPORT";
29927 const EXTRA_CRC: u8 = 1u8;
29928 const ENCODED_LEN: usize = 22usize;
29929 fn deser(
29930 _version: MavlinkVersion,
29931 __input: &[u8],
29932 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29933 let avail_len = __input.len();
29934 let mut payload_buf = [0; Self::ENCODED_LEN];
29935 let mut buf = if avail_len < Self::ENCODED_LEN {
29936 payload_buf[0..avail_len].copy_from_slice(__input);
29937 Bytes::new(&payload_buf)
29938 } else {
29939 Bytes::new(__input)
29940 };
29941 let mut __struct = Self::default();
29942 __struct.lat = buf.get_i32_le();
29943 __struct.lon = buf.get_i32_le();
29944 __struct.terrain_height = buf.get_f32_le();
29945 __struct.current_height = buf.get_f32_le();
29946 __struct.spacing = buf.get_u16_le();
29947 __struct.pending = buf.get_u16_le();
29948 __struct.loaded = buf.get_u16_le();
29949 Ok(__struct)
29950 }
29951 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29952 let mut __tmp = BytesMut::new(bytes);
29953 #[allow(clippy::absurd_extreme_comparisons)]
29954 #[allow(unused_comparisons)]
29955 if __tmp.remaining() < Self::ENCODED_LEN {
29956 panic!(
29957 "buffer is too small (need {} bytes, but got {})",
29958 Self::ENCODED_LEN,
29959 __tmp.remaining(),
29960 )
29961 }
29962 __tmp.put_i32_le(self.lat);
29963 __tmp.put_i32_le(self.lon);
29964 __tmp.put_f32_le(self.terrain_height);
29965 __tmp.put_f32_le(self.current_height);
29966 __tmp.put_u16_le(self.spacing);
29967 __tmp.put_u16_le(self.pending);
29968 __tmp.put_u16_le(self.loaded);
29969 if matches!(version, MavlinkVersion::V2) {
29970 let len = __tmp.len();
29971 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29972 } else {
29973 __tmp.len()
29974 }
29975 }
29976}
29977#[doc = "id: 133"]
29978#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29979#[derive(Debug, Clone, PartialEq)]
29980#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29981#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29982pub struct TERRAIN_REQUEST_DATA {
29983 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
29984 pub mask: u64,
29985 #[doc = "Latitude of SW corner of first grid"]
29986 pub lat: i32,
29987 #[doc = "Longitude of SW corner of first grid"]
29988 pub lon: i32,
29989 #[doc = "Grid spacing"]
29990 pub grid_spacing: u16,
29991}
29992impl TERRAIN_REQUEST_DATA {
29993 pub const ENCODED_LEN: usize = 18usize;
29994 pub const DEFAULT: Self = Self {
29995 mask: 0_u64,
29996 lat: 0_i32,
29997 lon: 0_i32,
29998 grid_spacing: 0_u16,
29999 };
30000 #[cfg(feature = "arbitrary")]
30001 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30002 use arbitrary::{Arbitrary, Unstructured};
30003 let mut buf = [0u8; 1024];
30004 rng.fill_bytes(&mut buf);
30005 let mut unstructured = Unstructured::new(&buf);
30006 Self::arbitrary(&mut unstructured).unwrap_or_default()
30007 }
30008}
30009impl Default for TERRAIN_REQUEST_DATA {
30010 fn default() -> Self {
30011 Self::DEFAULT.clone()
30012 }
30013}
30014impl MessageData for TERRAIN_REQUEST_DATA {
30015 type Message = MavMessage;
30016 const ID: u32 = 133u32;
30017 const NAME: &'static str = "TERRAIN_REQUEST";
30018 const EXTRA_CRC: u8 = 6u8;
30019 const ENCODED_LEN: usize = 18usize;
30020 fn deser(
30021 _version: MavlinkVersion,
30022 __input: &[u8],
30023 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30024 let avail_len = __input.len();
30025 let mut payload_buf = [0; Self::ENCODED_LEN];
30026 let mut buf = if avail_len < Self::ENCODED_LEN {
30027 payload_buf[0..avail_len].copy_from_slice(__input);
30028 Bytes::new(&payload_buf)
30029 } else {
30030 Bytes::new(__input)
30031 };
30032 let mut __struct = Self::default();
30033 __struct.mask = buf.get_u64_le();
30034 __struct.lat = buf.get_i32_le();
30035 __struct.lon = buf.get_i32_le();
30036 __struct.grid_spacing = buf.get_u16_le();
30037 Ok(__struct)
30038 }
30039 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30040 let mut __tmp = BytesMut::new(bytes);
30041 #[allow(clippy::absurd_extreme_comparisons)]
30042 #[allow(unused_comparisons)]
30043 if __tmp.remaining() < Self::ENCODED_LEN {
30044 panic!(
30045 "buffer is too small (need {} bytes, but got {})",
30046 Self::ENCODED_LEN,
30047 __tmp.remaining(),
30048 )
30049 }
30050 __tmp.put_u64_le(self.mask);
30051 __tmp.put_i32_le(self.lat);
30052 __tmp.put_i32_le(self.lon);
30053 __tmp.put_u16_le(self.grid_spacing);
30054 if matches!(version, MavlinkVersion::V2) {
30055 let len = __tmp.len();
30056 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30057 } else {
30058 __tmp.len()
30059 }
30060 }
30061}
30062#[doc = "id: 111"]
30063#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
30064#[derive(Debug, Clone, PartialEq)]
30065#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30066#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30067pub struct TIMESYNC_DATA {
30068 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
30069 pub tc1: i64,
30070 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
30071 pub ts1: i64,
30072 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
30073 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30074 pub target_system: u8,
30075 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
30076 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30077 pub target_component: u8,
30078}
30079impl TIMESYNC_DATA {
30080 pub const ENCODED_LEN: usize = 18usize;
30081 pub const DEFAULT: Self = Self {
30082 tc1: 0_i64,
30083 ts1: 0_i64,
30084 target_system: 0_u8,
30085 target_component: 0_u8,
30086 };
30087 #[cfg(feature = "arbitrary")]
30088 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30089 use arbitrary::{Arbitrary, Unstructured};
30090 let mut buf = [0u8; 1024];
30091 rng.fill_bytes(&mut buf);
30092 let mut unstructured = Unstructured::new(&buf);
30093 Self::arbitrary(&mut unstructured).unwrap_or_default()
30094 }
30095}
30096impl Default for TIMESYNC_DATA {
30097 fn default() -> Self {
30098 Self::DEFAULT.clone()
30099 }
30100}
30101impl MessageData for TIMESYNC_DATA {
30102 type Message = MavMessage;
30103 const ID: u32 = 111u32;
30104 const NAME: &'static str = "TIMESYNC";
30105 const EXTRA_CRC: u8 = 34u8;
30106 const ENCODED_LEN: usize = 18usize;
30107 fn deser(
30108 _version: MavlinkVersion,
30109 __input: &[u8],
30110 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30111 let avail_len = __input.len();
30112 let mut payload_buf = [0; Self::ENCODED_LEN];
30113 let mut buf = if avail_len < Self::ENCODED_LEN {
30114 payload_buf[0..avail_len].copy_from_slice(__input);
30115 Bytes::new(&payload_buf)
30116 } else {
30117 Bytes::new(__input)
30118 };
30119 let mut __struct = Self::default();
30120 __struct.tc1 = buf.get_i64_le();
30121 __struct.ts1 = buf.get_i64_le();
30122 __struct.target_system = buf.get_u8();
30123 __struct.target_component = buf.get_u8();
30124 Ok(__struct)
30125 }
30126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30127 let mut __tmp = BytesMut::new(bytes);
30128 #[allow(clippy::absurd_extreme_comparisons)]
30129 #[allow(unused_comparisons)]
30130 if __tmp.remaining() < Self::ENCODED_LEN {
30131 panic!(
30132 "buffer is too small (need {} bytes, but got {})",
30133 Self::ENCODED_LEN,
30134 __tmp.remaining(),
30135 )
30136 }
30137 __tmp.put_i64_le(self.tc1);
30138 __tmp.put_i64_le(self.ts1);
30139 __tmp.put_u8(self.target_system);
30140 __tmp.put_u8(self.target_component);
30141 if matches!(version, MavlinkVersion::V2) {
30142 let len = __tmp.len();
30143 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30144 } else {
30145 __tmp.len()
30146 }
30147 }
30148}
30149#[doc = "id: 380"]
30150#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
30151#[derive(Debug, Clone, PartialEq)]
30152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30153#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30154pub struct TIME_ESTIMATE_TO_TARGET_DATA {
30155 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
30156 pub safe_return: i32,
30157 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
30158 pub land: i32,
30159 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
30160 pub mission_next_item: i32,
30161 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
30162 pub mission_end: i32,
30163 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
30164 pub commanded_action: i32,
30165}
30166impl TIME_ESTIMATE_TO_TARGET_DATA {
30167 pub const ENCODED_LEN: usize = 20usize;
30168 pub const DEFAULT: Self = Self {
30169 safe_return: 0_i32,
30170 land: 0_i32,
30171 mission_next_item: 0_i32,
30172 mission_end: 0_i32,
30173 commanded_action: 0_i32,
30174 };
30175 #[cfg(feature = "arbitrary")]
30176 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30177 use arbitrary::{Arbitrary, Unstructured};
30178 let mut buf = [0u8; 1024];
30179 rng.fill_bytes(&mut buf);
30180 let mut unstructured = Unstructured::new(&buf);
30181 Self::arbitrary(&mut unstructured).unwrap_or_default()
30182 }
30183}
30184impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
30185 fn default() -> Self {
30186 Self::DEFAULT.clone()
30187 }
30188}
30189impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
30190 type Message = MavMessage;
30191 const ID: u32 = 380u32;
30192 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
30193 const EXTRA_CRC: u8 = 232u8;
30194 const ENCODED_LEN: usize = 20usize;
30195 fn deser(
30196 _version: MavlinkVersion,
30197 __input: &[u8],
30198 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30199 let avail_len = __input.len();
30200 let mut payload_buf = [0; Self::ENCODED_LEN];
30201 let mut buf = if avail_len < Self::ENCODED_LEN {
30202 payload_buf[0..avail_len].copy_from_slice(__input);
30203 Bytes::new(&payload_buf)
30204 } else {
30205 Bytes::new(__input)
30206 };
30207 let mut __struct = Self::default();
30208 __struct.safe_return = buf.get_i32_le();
30209 __struct.land = buf.get_i32_le();
30210 __struct.mission_next_item = buf.get_i32_le();
30211 __struct.mission_end = buf.get_i32_le();
30212 __struct.commanded_action = buf.get_i32_le();
30213 Ok(__struct)
30214 }
30215 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30216 let mut __tmp = BytesMut::new(bytes);
30217 #[allow(clippy::absurd_extreme_comparisons)]
30218 #[allow(unused_comparisons)]
30219 if __tmp.remaining() < Self::ENCODED_LEN {
30220 panic!(
30221 "buffer is too small (need {} bytes, but got {})",
30222 Self::ENCODED_LEN,
30223 __tmp.remaining(),
30224 )
30225 }
30226 __tmp.put_i32_le(self.safe_return);
30227 __tmp.put_i32_le(self.land);
30228 __tmp.put_i32_le(self.mission_next_item);
30229 __tmp.put_i32_le(self.mission_end);
30230 __tmp.put_i32_le(self.commanded_action);
30231 if matches!(version, MavlinkVersion::V2) {
30232 let len = __tmp.len();
30233 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30234 } else {
30235 __tmp.len()
30236 }
30237 }
30238}
30239#[doc = "id: 333"]
30240#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
30241#[derive(Debug, Clone, PartialEq)]
30242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30244pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30245 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30246 pub time_usec: u64,
30247 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
30248 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30249 pub pos_x: [f32; 5],
30250 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
30251 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30252 pub pos_y: [f32; 5],
30253 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
30254 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30255 pub pos_z: [f32; 5],
30256 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
30257 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30258 pub delta: [f32; 5],
30259 #[doc = "Yaw. Set to NaN for unchanged"]
30260 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30261 pub pos_yaw: [f32; 5],
30262 #[doc = "Number of valid control points (up-to 5 points are possible)"]
30263 pub valid_points: u8,
30264}
30265impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30266 pub const ENCODED_LEN: usize = 109usize;
30267 pub const DEFAULT: Self = Self {
30268 time_usec: 0_u64,
30269 pos_x: [0.0_f32; 5usize],
30270 pos_y: [0.0_f32; 5usize],
30271 pos_z: [0.0_f32; 5usize],
30272 delta: [0.0_f32; 5usize],
30273 pos_yaw: [0.0_f32; 5usize],
30274 valid_points: 0_u8,
30275 };
30276 #[cfg(feature = "arbitrary")]
30277 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30278 use arbitrary::{Arbitrary, Unstructured};
30279 let mut buf = [0u8; 1024];
30280 rng.fill_bytes(&mut buf);
30281 let mut unstructured = Unstructured::new(&buf);
30282 Self::arbitrary(&mut unstructured).unwrap_or_default()
30283 }
30284}
30285impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30286 fn default() -> Self {
30287 Self::DEFAULT.clone()
30288 }
30289}
30290impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30291 type Message = MavMessage;
30292 const ID: u32 = 333u32;
30293 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
30294 const EXTRA_CRC: u8 = 231u8;
30295 const ENCODED_LEN: usize = 109usize;
30296 fn deser(
30297 _version: MavlinkVersion,
30298 __input: &[u8],
30299 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30300 let avail_len = __input.len();
30301 let mut payload_buf = [0; Self::ENCODED_LEN];
30302 let mut buf = if avail_len < Self::ENCODED_LEN {
30303 payload_buf[0..avail_len].copy_from_slice(__input);
30304 Bytes::new(&payload_buf)
30305 } else {
30306 Bytes::new(__input)
30307 };
30308 let mut __struct = Self::default();
30309 __struct.time_usec = buf.get_u64_le();
30310 for v in &mut __struct.pos_x {
30311 let val = buf.get_f32_le();
30312 *v = val;
30313 }
30314 for v in &mut __struct.pos_y {
30315 let val = buf.get_f32_le();
30316 *v = val;
30317 }
30318 for v in &mut __struct.pos_z {
30319 let val = buf.get_f32_le();
30320 *v = val;
30321 }
30322 for v in &mut __struct.delta {
30323 let val = buf.get_f32_le();
30324 *v = val;
30325 }
30326 for v in &mut __struct.pos_yaw {
30327 let val = buf.get_f32_le();
30328 *v = val;
30329 }
30330 __struct.valid_points = buf.get_u8();
30331 Ok(__struct)
30332 }
30333 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30334 let mut __tmp = BytesMut::new(bytes);
30335 #[allow(clippy::absurd_extreme_comparisons)]
30336 #[allow(unused_comparisons)]
30337 if __tmp.remaining() < Self::ENCODED_LEN {
30338 panic!(
30339 "buffer is too small (need {} bytes, but got {})",
30340 Self::ENCODED_LEN,
30341 __tmp.remaining(),
30342 )
30343 }
30344 __tmp.put_u64_le(self.time_usec);
30345 for val in &self.pos_x {
30346 __tmp.put_f32_le(*val);
30347 }
30348 for val in &self.pos_y {
30349 __tmp.put_f32_le(*val);
30350 }
30351 for val in &self.pos_z {
30352 __tmp.put_f32_le(*val);
30353 }
30354 for val in &self.delta {
30355 __tmp.put_f32_le(*val);
30356 }
30357 for val in &self.pos_yaw {
30358 __tmp.put_f32_le(*val);
30359 }
30360 __tmp.put_u8(self.valid_points);
30361 if matches!(version, MavlinkVersion::V2) {
30362 let len = __tmp.len();
30363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30364 } else {
30365 __tmp.len()
30366 }
30367 }
30368}
30369#[doc = "id: 332"]
30370#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
30371#[derive(Debug, Clone, PartialEq)]
30372#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30373#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30374pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30375 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30376 pub time_usec: u64,
30377 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
30378 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30379 pub pos_x: [f32; 5],
30380 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
30381 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30382 pub pos_y: [f32; 5],
30383 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
30384 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30385 pub pos_z: [f32; 5],
30386 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
30387 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30388 pub vel_x: [f32; 5],
30389 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30390 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30391 pub vel_y: [f32; 5],
30392 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30393 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30394 pub vel_z: [f32; 5],
30395 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30396 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30397 pub acc_x: [f32; 5],
30398 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30399 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30400 pub acc_y: [f32; 5],
30401 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30402 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30403 pub acc_z: [f32; 5],
30404 #[doc = "Yaw angle, set to NaN if not being used"]
30405 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30406 pub pos_yaw: [f32; 5],
30407 #[doc = "Yaw rate, set to NaN if not being used"]
30408 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30409 pub vel_yaw: [f32; 5],
30410 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30411 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30412 pub command: [u16; 5],
30413 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30414 pub valid_points: u8,
30415}
30416impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30417 pub const ENCODED_LEN: usize = 239usize;
30418 pub const DEFAULT: Self = Self {
30419 time_usec: 0_u64,
30420 pos_x: [0.0_f32; 5usize],
30421 pos_y: [0.0_f32; 5usize],
30422 pos_z: [0.0_f32; 5usize],
30423 vel_x: [0.0_f32; 5usize],
30424 vel_y: [0.0_f32; 5usize],
30425 vel_z: [0.0_f32; 5usize],
30426 acc_x: [0.0_f32; 5usize],
30427 acc_y: [0.0_f32; 5usize],
30428 acc_z: [0.0_f32; 5usize],
30429 pos_yaw: [0.0_f32; 5usize],
30430 vel_yaw: [0.0_f32; 5usize],
30431 command: [0_u16; 5usize],
30432 valid_points: 0_u8,
30433 };
30434 #[cfg(feature = "arbitrary")]
30435 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30436 use arbitrary::{Arbitrary, Unstructured};
30437 let mut buf = [0u8; 1024];
30438 rng.fill_bytes(&mut buf);
30439 let mut unstructured = Unstructured::new(&buf);
30440 Self::arbitrary(&mut unstructured).unwrap_or_default()
30441 }
30442}
30443impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30444 fn default() -> Self {
30445 Self::DEFAULT.clone()
30446 }
30447}
30448impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30449 type Message = MavMessage;
30450 const ID: u32 = 332u32;
30451 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30452 const EXTRA_CRC: u8 = 236u8;
30453 const ENCODED_LEN: usize = 239usize;
30454 fn deser(
30455 _version: MavlinkVersion,
30456 __input: &[u8],
30457 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30458 let avail_len = __input.len();
30459 let mut payload_buf = [0; Self::ENCODED_LEN];
30460 let mut buf = if avail_len < Self::ENCODED_LEN {
30461 payload_buf[0..avail_len].copy_from_slice(__input);
30462 Bytes::new(&payload_buf)
30463 } else {
30464 Bytes::new(__input)
30465 };
30466 let mut __struct = Self::default();
30467 __struct.time_usec = buf.get_u64_le();
30468 for v in &mut __struct.pos_x {
30469 let val = buf.get_f32_le();
30470 *v = val;
30471 }
30472 for v in &mut __struct.pos_y {
30473 let val = buf.get_f32_le();
30474 *v = val;
30475 }
30476 for v in &mut __struct.pos_z {
30477 let val = buf.get_f32_le();
30478 *v = val;
30479 }
30480 for v in &mut __struct.vel_x {
30481 let val = buf.get_f32_le();
30482 *v = val;
30483 }
30484 for v in &mut __struct.vel_y {
30485 let val = buf.get_f32_le();
30486 *v = val;
30487 }
30488 for v in &mut __struct.vel_z {
30489 let val = buf.get_f32_le();
30490 *v = val;
30491 }
30492 for v in &mut __struct.acc_x {
30493 let val = buf.get_f32_le();
30494 *v = val;
30495 }
30496 for v in &mut __struct.acc_y {
30497 let val = buf.get_f32_le();
30498 *v = val;
30499 }
30500 for v in &mut __struct.acc_z {
30501 let val = buf.get_f32_le();
30502 *v = val;
30503 }
30504 for v in &mut __struct.pos_yaw {
30505 let val = buf.get_f32_le();
30506 *v = val;
30507 }
30508 for v in &mut __struct.vel_yaw {
30509 let val = buf.get_f32_le();
30510 *v = val;
30511 }
30512 for v in &mut __struct.command {
30513 let val = buf.get_u16_le();
30514 *v = val;
30515 }
30516 __struct.valid_points = buf.get_u8();
30517 Ok(__struct)
30518 }
30519 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30520 let mut __tmp = BytesMut::new(bytes);
30521 #[allow(clippy::absurd_extreme_comparisons)]
30522 #[allow(unused_comparisons)]
30523 if __tmp.remaining() < Self::ENCODED_LEN {
30524 panic!(
30525 "buffer is too small (need {} bytes, but got {})",
30526 Self::ENCODED_LEN,
30527 __tmp.remaining(),
30528 )
30529 }
30530 __tmp.put_u64_le(self.time_usec);
30531 for val in &self.pos_x {
30532 __tmp.put_f32_le(*val);
30533 }
30534 for val in &self.pos_y {
30535 __tmp.put_f32_le(*val);
30536 }
30537 for val in &self.pos_z {
30538 __tmp.put_f32_le(*val);
30539 }
30540 for val in &self.vel_x {
30541 __tmp.put_f32_le(*val);
30542 }
30543 for val in &self.vel_y {
30544 __tmp.put_f32_le(*val);
30545 }
30546 for val in &self.vel_z {
30547 __tmp.put_f32_le(*val);
30548 }
30549 for val in &self.acc_x {
30550 __tmp.put_f32_le(*val);
30551 }
30552 for val in &self.acc_y {
30553 __tmp.put_f32_le(*val);
30554 }
30555 for val in &self.acc_z {
30556 __tmp.put_f32_le(*val);
30557 }
30558 for val in &self.pos_yaw {
30559 __tmp.put_f32_le(*val);
30560 }
30561 for val in &self.vel_yaw {
30562 __tmp.put_f32_le(*val);
30563 }
30564 for val in &self.command {
30565 __tmp.put_u16_le(*val);
30566 }
30567 __tmp.put_u8(self.valid_points);
30568 if matches!(version, MavlinkVersion::V2) {
30569 let len = __tmp.len();
30570 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30571 } else {
30572 __tmp.len()
30573 }
30574 }
30575}
30576#[doc = "id: 385"]
30577#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
30578#[derive(Debug, Clone, PartialEq)]
30579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30581pub struct TUNNEL_DATA {
30582 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30583 pub payload_type: MavTunnelPayloadType,
30584 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
30585 pub target_system: u8,
30586 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
30587 pub target_component: u8,
30588 #[doc = "Length of the data transported in payload"]
30589 pub payload_length: u8,
30590 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
30591 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30592 pub payload: [u8; 128],
30593}
30594impl TUNNEL_DATA {
30595 pub const ENCODED_LEN: usize = 133usize;
30596 pub const DEFAULT: Self = Self {
30597 payload_type: MavTunnelPayloadType::DEFAULT,
30598 target_system: 0_u8,
30599 target_component: 0_u8,
30600 payload_length: 0_u8,
30601 payload: [0_u8; 128usize],
30602 };
30603 #[cfg(feature = "arbitrary")]
30604 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30605 use arbitrary::{Arbitrary, Unstructured};
30606 let mut buf = [0u8; 1024];
30607 rng.fill_bytes(&mut buf);
30608 let mut unstructured = Unstructured::new(&buf);
30609 Self::arbitrary(&mut unstructured).unwrap_or_default()
30610 }
30611}
30612impl Default for TUNNEL_DATA {
30613 fn default() -> Self {
30614 Self::DEFAULT.clone()
30615 }
30616}
30617impl MessageData for TUNNEL_DATA {
30618 type Message = MavMessage;
30619 const ID: u32 = 385u32;
30620 const NAME: &'static str = "TUNNEL";
30621 const EXTRA_CRC: u8 = 147u8;
30622 const ENCODED_LEN: usize = 133usize;
30623 fn deser(
30624 _version: MavlinkVersion,
30625 __input: &[u8],
30626 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30627 let avail_len = __input.len();
30628 let mut payload_buf = [0; Self::ENCODED_LEN];
30629 let mut buf = if avail_len < Self::ENCODED_LEN {
30630 payload_buf[0..avail_len].copy_from_slice(__input);
30631 Bytes::new(&payload_buf)
30632 } else {
30633 Bytes::new(__input)
30634 };
30635 let mut __struct = Self::default();
30636 let tmp = buf.get_u16_le();
30637 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
30638 ::mavlink_core::error::ParserError::InvalidEnum {
30639 enum_type: "MavTunnelPayloadType",
30640 value: tmp as u32,
30641 },
30642 )?;
30643 __struct.target_system = buf.get_u8();
30644 __struct.target_component = buf.get_u8();
30645 __struct.payload_length = buf.get_u8();
30646 for v in &mut __struct.payload {
30647 let val = buf.get_u8();
30648 *v = val;
30649 }
30650 Ok(__struct)
30651 }
30652 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30653 let mut __tmp = BytesMut::new(bytes);
30654 #[allow(clippy::absurd_extreme_comparisons)]
30655 #[allow(unused_comparisons)]
30656 if __tmp.remaining() < Self::ENCODED_LEN {
30657 panic!(
30658 "buffer is too small (need {} bytes, but got {})",
30659 Self::ENCODED_LEN,
30660 __tmp.remaining(),
30661 )
30662 }
30663 __tmp.put_u16_le(self.payload_type as u16);
30664 __tmp.put_u8(self.target_system);
30665 __tmp.put_u8(self.target_component);
30666 __tmp.put_u8(self.payload_length);
30667 for val in &self.payload {
30668 __tmp.put_u8(*val);
30669 }
30670 if matches!(version, MavlinkVersion::V2) {
30671 let len = __tmp.len();
30672 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30673 } else {
30674 __tmp.len()
30675 }
30676 }
30677}
30678#[doc = "id: 311"]
30679#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
30680#[derive(Debug, Clone, PartialEq)]
30681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30683pub struct UAVCAN_NODE_INFO_DATA {
30684 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30685 pub time_usec: u64,
30686 #[doc = "Time since the start-up of the node."]
30687 pub uptime_sec: u32,
30688 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
30689 pub sw_vcs_commit: u32,
30690 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
30691 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30692 pub name: [u8; 80],
30693 #[doc = "Hardware major version number."]
30694 pub hw_version_major: u8,
30695 #[doc = "Hardware minor version number."]
30696 pub hw_version_minor: u8,
30697 #[doc = "Hardware unique 128-bit ID."]
30698 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30699 pub hw_unique_id: [u8; 16],
30700 #[doc = "Software major version number."]
30701 pub sw_version_major: u8,
30702 #[doc = "Software minor version number."]
30703 pub sw_version_minor: u8,
30704}
30705impl UAVCAN_NODE_INFO_DATA {
30706 pub const ENCODED_LEN: usize = 116usize;
30707 pub const DEFAULT: Self = Self {
30708 time_usec: 0_u64,
30709 uptime_sec: 0_u32,
30710 sw_vcs_commit: 0_u32,
30711 name: [0_u8; 80usize],
30712 hw_version_major: 0_u8,
30713 hw_version_minor: 0_u8,
30714 hw_unique_id: [0_u8; 16usize],
30715 sw_version_major: 0_u8,
30716 sw_version_minor: 0_u8,
30717 };
30718 #[cfg(feature = "arbitrary")]
30719 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30720 use arbitrary::{Arbitrary, Unstructured};
30721 let mut buf = [0u8; 1024];
30722 rng.fill_bytes(&mut buf);
30723 let mut unstructured = Unstructured::new(&buf);
30724 Self::arbitrary(&mut unstructured).unwrap_or_default()
30725 }
30726}
30727impl Default for UAVCAN_NODE_INFO_DATA {
30728 fn default() -> Self {
30729 Self::DEFAULT.clone()
30730 }
30731}
30732impl MessageData for UAVCAN_NODE_INFO_DATA {
30733 type Message = MavMessage;
30734 const ID: u32 = 311u32;
30735 const NAME: &'static str = "UAVCAN_NODE_INFO";
30736 const EXTRA_CRC: u8 = 95u8;
30737 const ENCODED_LEN: usize = 116usize;
30738 fn deser(
30739 _version: MavlinkVersion,
30740 __input: &[u8],
30741 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30742 let avail_len = __input.len();
30743 let mut payload_buf = [0; Self::ENCODED_LEN];
30744 let mut buf = if avail_len < Self::ENCODED_LEN {
30745 payload_buf[0..avail_len].copy_from_slice(__input);
30746 Bytes::new(&payload_buf)
30747 } else {
30748 Bytes::new(__input)
30749 };
30750 let mut __struct = Self::default();
30751 __struct.time_usec = buf.get_u64_le();
30752 __struct.uptime_sec = buf.get_u32_le();
30753 __struct.sw_vcs_commit = buf.get_u32_le();
30754 for v in &mut __struct.name {
30755 let val = buf.get_u8();
30756 *v = val;
30757 }
30758 __struct.hw_version_major = buf.get_u8();
30759 __struct.hw_version_minor = buf.get_u8();
30760 for v in &mut __struct.hw_unique_id {
30761 let val = buf.get_u8();
30762 *v = val;
30763 }
30764 __struct.sw_version_major = buf.get_u8();
30765 __struct.sw_version_minor = buf.get_u8();
30766 Ok(__struct)
30767 }
30768 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30769 let mut __tmp = BytesMut::new(bytes);
30770 #[allow(clippy::absurd_extreme_comparisons)]
30771 #[allow(unused_comparisons)]
30772 if __tmp.remaining() < Self::ENCODED_LEN {
30773 panic!(
30774 "buffer is too small (need {} bytes, but got {})",
30775 Self::ENCODED_LEN,
30776 __tmp.remaining(),
30777 )
30778 }
30779 __tmp.put_u64_le(self.time_usec);
30780 __tmp.put_u32_le(self.uptime_sec);
30781 __tmp.put_u32_le(self.sw_vcs_commit);
30782 for val in &self.name {
30783 __tmp.put_u8(*val);
30784 }
30785 __tmp.put_u8(self.hw_version_major);
30786 __tmp.put_u8(self.hw_version_minor);
30787 for val in &self.hw_unique_id {
30788 __tmp.put_u8(*val);
30789 }
30790 __tmp.put_u8(self.sw_version_major);
30791 __tmp.put_u8(self.sw_version_minor);
30792 if matches!(version, MavlinkVersion::V2) {
30793 let len = __tmp.len();
30794 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30795 } else {
30796 __tmp.len()
30797 }
30798 }
30799}
30800#[doc = "id: 310"]
30801#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
30802#[derive(Debug, Clone, PartialEq)]
30803#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30804#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30805pub struct UAVCAN_NODE_STATUS_DATA {
30806 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30807 pub time_usec: u64,
30808 #[doc = "Time since the start-up of the node."]
30809 pub uptime_sec: u32,
30810 #[doc = "Vendor-specific status information."]
30811 pub vendor_specific_status_code: u16,
30812 #[doc = "Generalized node health status."]
30813 pub health: UavcanNodeHealth,
30814 #[doc = "Generalized operating mode."]
30815 pub mode: UavcanNodeMode,
30816 #[doc = "Not used currently."]
30817 pub sub_mode: u8,
30818}
30819impl UAVCAN_NODE_STATUS_DATA {
30820 pub const ENCODED_LEN: usize = 17usize;
30821 pub const DEFAULT: Self = Self {
30822 time_usec: 0_u64,
30823 uptime_sec: 0_u32,
30824 vendor_specific_status_code: 0_u16,
30825 health: UavcanNodeHealth::DEFAULT,
30826 mode: UavcanNodeMode::DEFAULT,
30827 sub_mode: 0_u8,
30828 };
30829 #[cfg(feature = "arbitrary")]
30830 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30831 use arbitrary::{Arbitrary, Unstructured};
30832 let mut buf = [0u8; 1024];
30833 rng.fill_bytes(&mut buf);
30834 let mut unstructured = Unstructured::new(&buf);
30835 Self::arbitrary(&mut unstructured).unwrap_or_default()
30836 }
30837}
30838impl Default for UAVCAN_NODE_STATUS_DATA {
30839 fn default() -> Self {
30840 Self::DEFAULT.clone()
30841 }
30842}
30843impl MessageData for UAVCAN_NODE_STATUS_DATA {
30844 type Message = MavMessage;
30845 const ID: u32 = 310u32;
30846 const NAME: &'static str = "UAVCAN_NODE_STATUS";
30847 const EXTRA_CRC: u8 = 28u8;
30848 const ENCODED_LEN: usize = 17usize;
30849 fn deser(
30850 _version: MavlinkVersion,
30851 __input: &[u8],
30852 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30853 let avail_len = __input.len();
30854 let mut payload_buf = [0; Self::ENCODED_LEN];
30855 let mut buf = if avail_len < Self::ENCODED_LEN {
30856 payload_buf[0..avail_len].copy_from_slice(__input);
30857 Bytes::new(&payload_buf)
30858 } else {
30859 Bytes::new(__input)
30860 };
30861 let mut __struct = Self::default();
30862 __struct.time_usec = buf.get_u64_le();
30863 __struct.uptime_sec = buf.get_u32_le();
30864 __struct.vendor_specific_status_code = buf.get_u16_le();
30865 let tmp = buf.get_u8();
30866 __struct.health =
30867 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30868 enum_type: "UavcanNodeHealth",
30869 value: tmp as u32,
30870 })?;
30871 let tmp = buf.get_u8();
30872 __struct.mode =
30873 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30874 enum_type: "UavcanNodeMode",
30875 value: tmp as u32,
30876 })?;
30877 __struct.sub_mode = buf.get_u8();
30878 Ok(__struct)
30879 }
30880 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30881 let mut __tmp = BytesMut::new(bytes);
30882 #[allow(clippy::absurd_extreme_comparisons)]
30883 #[allow(unused_comparisons)]
30884 if __tmp.remaining() < Self::ENCODED_LEN {
30885 panic!(
30886 "buffer is too small (need {} bytes, but got {})",
30887 Self::ENCODED_LEN,
30888 __tmp.remaining(),
30889 )
30890 }
30891 __tmp.put_u64_le(self.time_usec);
30892 __tmp.put_u32_le(self.uptime_sec);
30893 __tmp.put_u16_le(self.vendor_specific_status_code);
30894 __tmp.put_u8(self.health as u8);
30895 __tmp.put_u8(self.mode as u8);
30896 __tmp.put_u8(self.sub_mode);
30897 if matches!(version, MavlinkVersion::V2) {
30898 let len = __tmp.len();
30899 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30900 } else {
30901 __tmp.len()
30902 }
30903 }
30904}
30905#[doc = "id: 340"]
30906#[doc = "The global position resulting from GPS and sensor fusion."]
30907#[derive(Debug, Clone, PartialEq)]
30908#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30909#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30910pub struct UTM_GLOBAL_POSITION_DATA {
30911 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
30912 pub time: u64,
30913 #[doc = "Latitude (WGS84)"]
30914 pub lat: i32,
30915 #[doc = "Longitude (WGS84)"]
30916 pub lon: i32,
30917 #[doc = "Altitude (WGS84)"]
30918 pub alt: i32,
30919 #[doc = "Altitude above ground"]
30920 pub relative_alt: i32,
30921 #[doc = "Next waypoint, latitude (WGS84)"]
30922 pub next_lat: i32,
30923 #[doc = "Next waypoint, longitude (WGS84)"]
30924 pub next_lon: i32,
30925 #[doc = "Next waypoint, altitude (WGS84)"]
30926 pub next_alt: i32,
30927 #[doc = "Ground X speed (latitude, positive north)"]
30928 pub vx: i16,
30929 #[doc = "Ground Y speed (longitude, positive east)"]
30930 pub vy: i16,
30931 #[doc = "Ground Z speed (altitude, positive down)"]
30932 pub vz: i16,
30933 #[doc = "Horizontal position uncertainty (standard deviation)"]
30934 pub h_acc: u16,
30935 #[doc = "Altitude uncertainty (standard deviation)"]
30936 pub v_acc: u16,
30937 #[doc = "Speed uncertainty (standard deviation)"]
30938 pub vel_acc: u16,
30939 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
30940 pub update_rate: u16,
30941 #[doc = "Unique UAS ID."]
30942 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30943 pub uas_id: [u8; 18],
30944 #[doc = "Flight state"]
30945 pub flight_state: UtmFlightState,
30946 #[doc = "Bitwise OR combination of the data available flags."]
30947 pub flags: UtmDataAvailFlags,
30948}
30949impl UTM_GLOBAL_POSITION_DATA {
30950 pub const ENCODED_LEN: usize = 70usize;
30951 pub const DEFAULT: Self = Self {
30952 time: 0_u64,
30953 lat: 0_i32,
30954 lon: 0_i32,
30955 alt: 0_i32,
30956 relative_alt: 0_i32,
30957 next_lat: 0_i32,
30958 next_lon: 0_i32,
30959 next_alt: 0_i32,
30960 vx: 0_i16,
30961 vy: 0_i16,
30962 vz: 0_i16,
30963 h_acc: 0_u16,
30964 v_acc: 0_u16,
30965 vel_acc: 0_u16,
30966 update_rate: 0_u16,
30967 uas_id: [0_u8; 18usize],
30968 flight_state: UtmFlightState::DEFAULT,
30969 flags: UtmDataAvailFlags::DEFAULT,
30970 };
30971 #[cfg(feature = "arbitrary")]
30972 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30973 use arbitrary::{Arbitrary, Unstructured};
30974 let mut buf = [0u8; 1024];
30975 rng.fill_bytes(&mut buf);
30976 let mut unstructured = Unstructured::new(&buf);
30977 Self::arbitrary(&mut unstructured).unwrap_or_default()
30978 }
30979}
30980impl Default for UTM_GLOBAL_POSITION_DATA {
30981 fn default() -> Self {
30982 Self::DEFAULT.clone()
30983 }
30984}
30985impl MessageData for UTM_GLOBAL_POSITION_DATA {
30986 type Message = MavMessage;
30987 const ID: u32 = 340u32;
30988 const NAME: &'static str = "UTM_GLOBAL_POSITION";
30989 const EXTRA_CRC: u8 = 99u8;
30990 const ENCODED_LEN: usize = 70usize;
30991 fn deser(
30992 _version: MavlinkVersion,
30993 __input: &[u8],
30994 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30995 let avail_len = __input.len();
30996 let mut payload_buf = [0; Self::ENCODED_LEN];
30997 let mut buf = if avail_len < Self::ENCODED_LEN {
30998 payload_buf[0..avail_len].copy_from_slice(__input);
30999 Bytes::new(&payload_buf)
31000 } else {
31001 Bytes::new(__input)
31002 };
31003 let mut __struct = Self::default();
31004 __struct.time = buf.get_u64_le();
31005 __struct.lat = buf.get_i32_le();
31006 __struct.lon = buf.get_i32_le();
31007 __struct.alt = buf.get_i32_le();
31008 __struct.relative_alt = buf.get_i32_le();
31009 __struct.next_lat = buf.get_i32_le();
31010 __struct.next_lon = buf.get_i32_le();
31011 __struct.next_alt = buf.get_i32_le();
31012 __struct.vx = buf.get_i16_le();
31013 __struct.vy = buf.get_i16_le();
31014 __struct.vz = buf.get_i16_le();
31015 __struct.h_acc = buf.get_u16_le();
31016 __struct.v_acc = buf.get_u16_le();
31017 __struct.vel_acc = buf.get_u16_le();
31018 __struct.update_rate = buf.get_u16_le();
31019 for v in &mut __struct.uas_id {
31020 let val = buf.get_u8();
31021 *v = val;
31022 }
31023 let tmp = buf.get_u8();
31024 __struct.flight_state =
31025 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31026 enum_type: "UtmFlightState",
31027 value: tmp as u32,
31028 })?;
31029 let tmp = buf.get_u8();
31030 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
31031 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31032 flag_type: "UtmDataAvailFlags",
31033 value: tmp as u32,
31034 })?;
31035 Ok(__struct)
31036 }
31037 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31038 let mut __tmp = BytesMut::new(bytes);
31039 #[allow(clippy::absurd_extreme_comparisons)]
31040 #[allow(unused_comparisons)]
31041 if __tmp.remaining() < Self::ENCODED_LEN {
31042 panic!(
31043 "buffer is too small (need {} bytes, but got {})",
31044 Self::ENCODED_LEN,
31045 __tmp.remaining(),
31046 )
31047 }
31048 __tmp.put_u64_le(self.time);
31049 __tmp.put_i32_le(self.lat);
31050 __tmp.put_i32_le(self.lon);
31051 __tmp.put_i32_le(self.alt);
31052 __tmp.put_i32_le(self.relative_alt);
31053 __tmp.put_i32_le(self.next_lat);
31054 __tmp.put_i32_le(self.next_lon);
31055 __tmp.put_i32_le(self.next_alt);
31056 __tmp.put_i16_le(self.vx);
31057 __tmp.put_i16_le(self.vy);
31058 __tmp.put_i16_le(self.vz);
31059 __tmp.put_u16_le(self.h_acc);
31060 __tmp.put_u16_le(self.v_acc);
31061 __tmp.put_u16_le(self.vel_acc);
31062 __tmp.put_u16_le(self.update_rate);
31063 for val in &self.uas_id {
31064 __tmp.put_u8(*val);
31065 }
31066 __tmp.put_u8(self.flight_state as u8);
31067 __tmp.put_u8(self.flags.bits());
31068 if matches!(version, MavlinkVersion::V2) {
31069 let len = __tmp.len();
31070 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31071 } else {
31072 __tmp.len()
31073 }
31074 }
31075}
31076#[doc = "id: 248"]
31077#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
31078#[derive(Debug, Clone, PartialEq)]
31079#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31080#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31081pub struct V2_EXTENSION_DATA {
31082 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31083 pub message_type: u16,
31084 #[doc = "Network ID (0 for broadcast)"]
31085 pub target_network: u8,
31086 #[doc = "System ID (0 for broadcast)"]
31087 pub target_system: u8,
31088 #[doc = "Component ID (0 for broadcast)"]
31089 pub target_component: u8,
31090 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
31091 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31092 pub payload: [u8; 249],
31093}
31094impl V2_EXTENSION_DATA {
31095 pub const ENCODED_LEN: usize = 254usize;
31096 pub const DEFAULT: Self = Self {
31097 message_type: 0_u16,
31098 target_network: 0_u8,
31099 target_system: 0_u8,
31100 target_component: 0_u8,
31101 payload: [0_u8; 249usize],
31102 };
31103 #[cfg(feature = "arbitrary")]
31104 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31105 use arbitrary::{Arbitrary, Unstructured};
31106 let mut buf = [0u8; 1024];
31107 rng.fill_bytes(&mut buf);
31108 let mut unstructured = Unstructured::new(&buf);
31109 Self::arbitrary(&mut unstructured).unwrap_or_default()
31110 }
31111}
31112impl Default for V2_EXTENSION_DATA {
31113 fn default() -> Self {
31114 Self::DEFAULT.clone()
31115 }
31116}
31117impl MessageData for V2_EXTENSION_DATA {
31118 type Message = MavMessage;
31119 const ID: u32 = 248u32;
31120 const NAME: &'static str = "V2_EXTENSION";
31121 const EXTRA_CRC: u8 = 8u8;
31122 const ENCODED_LEN: usize = 254usize;
31123 fn deser(
31124 _version: MavlinkVersion,
31125 __input: &[u8],
31126 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31127 let avail_len = __input.len();
31128 let mut payload_buf = [0; Self::ENCODED_LEN];
31129 let mut buf = if avail_len < Self::ENCODED_LEN {
31130 payload_buf[0..avail_len].copy_from_slice(__input);
31131 Bytes::new(&payload_buf)
31132 } else {
31133 Bytes::new(__input)
31134 };
31135 let mut __struct = Self::default();
31136 __struct.message_type = buf.get_u16_le();
31137 __struct.target_network = buf.get_u8();
31138 __struct.target_system = buf.get_u8();
31139 __struct.target_component = buf.get_u8();
31140 for v in &mut __struct.payload {
31141 let val = buf.get_u8();
31142 *v = val;
31143 }
31144 Ok(__struct)
31145 }
31146 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31147 let mut __tmp = BytesMut::new(bytes);
31148 #[allow(clippy::absurd_extreme_comparisons)]
31149 #[allow(unused_comparisons)]
31150 if __tmp.remaining() < Self::ENCODED_LEN {
31151 panic!(
31152 "buffer is too small (need {} bytes, but got {})",
31153 Self::ENCODED_LEN,
31154 __tmp.remaining(),
31155 )
31156 }
31157 __tmp.put_u16_le(self.message_type);
31158 __tmp.put_u8(self.target_network);
31159 __tmp.put_u8(self.target_system);
31160 __tmp.put_u8(self.target_component);
31161 for val in &self.payload {
31162 __tmp.put_u8(*val);
31163 }
31164 if matches!(version, MavlinkVersion::V2) {
31165 let len = __tmp.len();
31166 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31167 } else {
31168 __tmp.len()
31169 }
31170 }
31171}
31172#[doc = "id: 355"]
31173#[doc = "Current limits for horizontal speed, vertical speed and yaw rate, as set by SET_VELOCITY_LIMITS."]
31174#[derive(Debug, Clone, PartialEq)]
31175#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31177pub struct VELOCITY_LIMITS_DATA {
31178 #[doc = "Limit for horizontal movement in MAV_FRAME_LOCAL_NED. NaN: No limit applied"]
31179 pub horizontal_speed_limit: f32,
31180 #[doc = "Limit for vertical movement in MAV_FRAME_LOCAL_NED. NaN: No limit applied"]
31181 pub vertical_speed_limit: f32,
31182 #[doc = "Limit for vehicle turn rate around its yaw axis. NaN: No limit applied"]
31183 pub yaw_rate_limit: f32,
31184}
31185impl VELOCITY_LIMITS_DATA {
31186 pub const ENCODED_LEN: usize = 12usize;
31187 pub const DEFAULT: Self = Self {
31188 horizontal_speed_limit: 0.0_f32,
31189 vertical_speed_limit: 0.0_f32,
31190 yaw_rate_limit: 0.0_f32,
31191 };
31192 #[cfg(feature = "arbitrary")]
31193 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31194 use arbitrary::{Arbitrary, Unstructured};
31195 let mut buf = [0u8; 1024];
31196 rng.fill_bytes(&mut buf);
31197 let mut unstructured = Unstructured::new(&buf);
31198 Self::arbitrary(&mut unstructured).unwrap_or_default()
31199 }
31200}
31201impl Default for VELOCITY_LIMITS_DATA {
31202 fn default() -> Self {
31203 Self::DEFAULT.clone()
31204 }
31205}
31206impl MessageData for VELOCITY_LIMITS_DATA {
31207 type Message = MavMessage;
31208 const ID: u32 = 355u32;
31209 const NAME: &'static str = "VELOCITY_LIMITS";
31210 const EXTRA_CRC: u8 = 6u8;
31211 const ENCODED_LEN: usize = 12usize;
31212 fn deser(
31213 _version: MavlinkVersion,
31214 __input: &[u8],
31215 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31216 let avail_len = __input.len();
31217 let mut payload_buf = [0; Self::ENCODED_LEN];
31218 let mut buf = if avail_len < Self::ENCODED_LEN {
31219 payload_buf[0..avail_len].copy_from_slice(__input);
31220 Bytes::new(&payload_buf)
31221 } else {
31222 Bytes::new(__input)
31223 };
31224 let mut __struct = Self::default();
31225 __struct.horizontal_speed_limit = buf.get_f32_le();
31226 __struct.vertical_speed_limit = buf.get_f32_le();
31227 __struct.yaw_rate_limit = buf.get_f32_le();
31228 Ok(__struct)
31229 }
31230 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31231 let mut __tmp = BytesMut::new(bytes);
31232 #[allow(clippy::absurd_extreme_comparisons)]
31233 #[allow(unused_comparisons)]
31234 if __tmp.remaining() < Self::ENCODED_LEN {
31235 panic!(
31236 "buffer is too small (need {} bytes, but got {})",
31237 Self::ENCODED_LEN,
31238 __tmp.remaining(),
31239 )
31240 }
31241 __tmp.put_f32_le(self.horizontal_speed_limit);
31242 __tmp.put_f32_le(self.vertical_speed_limit);
31243 __tmp.put_f32_le(self.yaw_rate_limit);
31244 if matches!(version, MavlinkVersion::V2) {
31245 let len = __tmp.len();
31246 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31247 } else {
31248 __tmp.len()
31249 }
31250 }
31251}
31252#[doc = "id: 74"]
31253#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
31254#[derive(Debug, Clone, PartialEq)]
31255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31257pub struct VFR_HUD_DATA {
31258 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
31259 pub airspeed: f32,
31260 #[doc = "Current ground speed."]
31261 pub groundspeed: f32,
31262 #[doc = "Current altitude (MSL)."]
31263 pub alt: f32,
31264 #[doc = "Current climb rate."]
31265 pub climb: f32,
31266 #[doc = "Current heading in compass units (0-360, 0=north)."]
31267 pub heading: i16,
31268 #[doc = "Current throttle setting (0 to 100)."]
31269 pub throttle: u16,
31270}
31271impl VFR_HUD_DATA {
31272 pub const ENCODED_LEN: usize = 20usize;
31273 pub const DEFAULT: Self = Self {
31274 airspeed: 0.0_f32,
31275 groundspeed: 0.0_f32,
31276 alt: 0.0_f32,
31277 climb: 0.0_f32,
31278 heading: 0_i16,
31279 throttle: 0_u16,
31280 };
31281 #[cfg(feature = "arbitrary")]
31282 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31283 use arbitrary::{Arbitrary, Unstructured};
31284 let mut buf = [0u8; 1024];
31285 rng.fill_bytes(&mut buf);
31286 let mut unstructured = Unstructured::new(&buf);
31287 Self::arbitrary(&mut unstructured).unwrap_or_default()
31288 }
31289}
31290impl Default for VFR_HUD_DATA {
31291 fn default() -> Self {
31292 Self::DEFAULT.clone()
31293 }
31294}
31295impl MessageData for VFR_HUD_DATA {
31296 type Message = MavMessage;
31297 const ID: u32 = 74u32;
31298 const NAME: &'static str = "VFR_HUD";
31299 const EXTRA_CRC: u8 = 20u8;
31300 const ENCODED_LEN: usize = 20usize;
31301 fn deser(
31302 _version: MavlinkVersion,
31303 __input: &[u8],
31304 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31305 let avail_len = __input.len();
31306 let mut payload_buf = [0; Self::ENCODED_LEN];
31307 let mut buf = if avail_len < Self::ENCODED_LEN {
31308 payload_buf[0..avail_len].copy_from_slice(__input);
31309 Bytes::new(&payload_buf)
31310 } else {
31311 Bytes::new(__input)
31312 };
31313 let mut __struct = Self::default();
31314 __struct.airspeed = buf.get_f32_le();
31315 __struct.groundspeed = buf.get_f32_le();
31316 __struct.alt = buf.get_f32_le();
31317 __struct.climb = buf.get_f32_le();
31318 __struct.heading = buf.get_i16_le();
31319 __struct.throttle = buf.get_u16_le();
31320 Ok(__struct)
31321 }
31322 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31323 let mut __tmp = BytesMut::new(bytes);
31324 #[allow(clippy::absurd_extreme_comparisons)]
31325 #[allow(unused_comparisons)]
31326 if __tmp.remaining() < Self::ENCODED_LEN {
31327 panic!(
31328 "buffer is too small (need {} bytes, but got {})",
31329 Self::ENCODED_LEN,
31330 __tmp.remaining(),
31331 )
31332 }
31333 __tmp.put_f32_le(self.airspeed);
31334 __tmp.put_f32_le(self.groundspeed);
31335 __tmp.put_f32_le(self.alt);
31336 __tmp.put_f32_le(self.climb);
31337 __tmp.put_i16_le(self.heading);
31338 __tmp.put_u16_le(self.throttle);
31339 if matches!(version, MavlinkVersion::V2) {
31340 let len = __tmp.len();
31341 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31342 } else {
31343 __tmp.len()
31344 }
31345 }
31346}
31347#[doc = "id: 241"]
31348#[doc = "Vibration levels and accelerometer clipping."]
31349#[derive(Debug, Clone, PartialEq)]
31350#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31352pub struct VIBRATION_DATA {
31353 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31354 pub time_usec: u64,
31355 #[doc = "Vibration levels on X-axis"]
31356 pub vibration_x: f32,
31357 #[doc = "Vibration levels on Y-axis"]
31358 pub vibration_y: f32,
31359 #[doc = "Vibration levels on Z-axis"]
31360 pub vibration_z: f32,
31361 #[doc = "first accelerometer clipping count"]
31362 pub clipping_0: u32,
31363 #[doc = "second accelerometer clipping count"]
31364 pub clipping_1: u32,
31365 #[doc = "third accelerometer clipping count"]
31366 pub clipping_2: u32,
31367}
31368impl VIBRATION_DATA {
31369 pub const ENCODED_LEN: usize = 32usize;
31370 pub const DEFAULT: Self = Self {
31371 time_usec: 0_u64,
31372 vibration_x: 0.0_f32,
31373 vibration_y: 0.0_f32,
31374 vibration_z: 0.0_f32,
31375 clipping_0: 0_u32,
31376 clipping_1: 0_u32,
31377 clipping_2: 0_u32,
31378 };
31379 #[cfg(feature = "arbitrary")]
31380 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31381 use arbitrary::{Arbitrary, Unstructured};
31382 let mut buf = [0u8; 1024];
31383 rng.fill_bytes(&mut buf);
31384 let mut unstructured = Unstructured::new(&buf);
31385 Self::arbitrary(&mut unstructured).unwrap_or_default()
31386 }
31387}
31388impl Default for VIBRATION_DATA {
31389 fn default() -> Self {
31390 Self::DEFAULT.clone()
31391 }
31392}
31393impl MessageData for VIBRATION_DATA {
31394 type Message = MavMessage;
31395 const ID: u32 = 241u32;
31396 const NAME: &'static str = "VIBRATION";
31397 const EXTRA_CRC: u8 = 90u8;
31398 const ENCODED_LEN: usize = 32usize;
31399 fn deser(
31400 _version: MavlinkVersion,
31401 __input: &[u8],
31402 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31403 let avail_len = __input.len();
31404 let mut payload_buf = [0; Self::ENCODED_LEN];
31405 let mut buf = if avail_len < Self::ENCODED_LEN {
31406 payload_buf[0..avail_len].copy_from_slice(__input);
31407 Bytes::new(&payload_buf)
31408 } else {
31409 Bytes::new(__input)
31410 };
31411 let mut __struct = Self::default();
31412 __struct.time_usec = buf.get_u64_le();
31413 __struct.vibration_x = buf.get_f32_le();
31414 __struct.vibration_y = buf.get_f32_le();
31415 __struct.vibration_z = buf.get_f32_le();
31416 __struct.clipping_0 = buf.get_u32_le();
31417 __struct.clipping_1 = buf.get_u32_le();
31418 __struct.clipping_2 = buf.get_u32_le();
31419 Ok(__struct)
31420 }
31421 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31422 let mut __tmp = BytesMut::new(bytes);
31423 #[allow(clippy::absurd_extreme_comparisons)]
31424 #[allow(unused_comparisons)]
31425 if __tmp.remaining() < Self::ENCODED_LEN {
31426 panic!(
31427 "buffer is too small (need {} bytes, but got {})",
31428 Self::ENCODED_LEN,
31429 __tmp.remaining(),
31430 )
31431 }
31432 __tmp.put_u64_le(self.time_usec);
31433 __tmp.put_f32_le(self.vibration_x);
31434 __tmp.put_f32_le(self.vibration_y);
31435 __tmp.put_f32_le(self.vibration_z);
31436 __tmp.put_u32_le(self.clipping_0);
31437 __tmp.put_u32_le(self.clipping_1);
31438 __tmp.put_u32_le(self.clipping_2);
31439 if matches!(version, MavlinkVersion::V2) {
31440 let len = __tmp.len();
31441 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31442 } else {
31443 __tmp.len()
31444 }
31445 }
31446}
31447#[doc = "id: 104"]
31448#[doc = "Global position estimate from a Vicon motion system source."]
31449#[derive(Debug, Clone, PartialEq)]
31450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31452pub struct VICON_POSITION_ESTIMATE_DATA {
31453 #[doc = "Timestamp (UNIX time or time since system boot)"]
31454 pub usec: u64,
31455 #[doc = "Global X position"]
31456 pub x: f32,
31457 #[doc = "Global Y position"]
31458 pub y: f32,
31459 #[doc = "Global Z position"]
31460 pub z: f32,
31461 #[doc = "Roll angle"]
31462 pub roll: f32,
31463 #[doc = "Pitch angle"]
31464 pub pitch: f32,
31465 #[doc = "Yaw angle"]
31466 pub yaw: f32,
31467 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31468 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31469 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31470 pub covariance: [f32; 21],
31471}
31472impl VICON_POSITION_ESTIMATE_DATA {
31473 pub const ENCODED_LEN: usize = 116usize;
31474 pub const DEFAULT: Self = Self {
31475 usec: 0_u64,
31476 x: 0.0_f32,
31477 y: 0.0_f32,
31478 z: 0.0_f32,
31479 roll: 0.0_f32,
31480 pitch: 0.0_f32,
31481 yaw: 0.0_f32,
31482 covariance: [0.0_f32; 21usize],
31483 };
31484 #[cfg(feature = "arbitrary")]
31485 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31486 use arbitrary::{Arbitrary, Unstructured};
31487 let mut buf = [0u8; 1024];
31488 rng.fill_bytes(&mut buf);
31489 let mut unstructured = Unstructured::new(&buf);
31490 Self::arbitrary(&mut unstructured).unwrap_or_default()
31491 }
31492}
31493impl Default for VICON_POSITION_ESTIMATE_DATA {
31494 fn default() -> Self {
31495 Self::DEFAULT.clone()
31496 }
31497}
31498impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31499 type Message = MavMessage;
31500 const ID: u32 = 104u32;
31501 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31502 const EXTRA_CRC: u8 = 56u8;
31503 const ENCODED_LEN: usize = 116usize;
31504 fn deser(
31505 _version: MavlinkVersion,
31506 __input: &[u8],
31507 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31508 let avail_len = __input.len();
31509 let mut payload_buf = [0; Self::ENCODED_LEN];
31510 let mut buf = if avail_len < Self::ENCODED_LEN {
31511 payload_buf[0..avail_len].copy_from_slice(__input);
31512 Bytes::new(&payload_buf)
31513 } else {
31514 Bytes::new(__input)
31515 };
31516 let mut __struct = Self::default();
31517 __struct.usec = buf.get_u64_le();
31518 __struct.x = buf.get_f32_le();
31519 __struct.y = buf.get_f32_le();
31520 __struct.z = buf.get_f32_le();
31521 __struct.roll = buf.get_f32_le();
31522 __struct.pitch = buf.get_f32_le();
31523 __struct.yaw = buf.get_f32_le();
31524 for v in &mut __struct.covariance {
31525 let val = buf.get_f32_le();
31526 *v = val;
31527 }
31528 Ok(__struct)
31529 }
31530 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31531 let mut __tmp = BytesMut::new(bytes);
31532 #[allow(clippy::absurd_extreme_comparisons)]
31533 #[allow(unused_comparisons)]
31534 if __tmp.remaining() < Self::ENCODED_LEN {
31535 panic!(
31536 "buffer is too small (need {} bytes, but got {})",
31537 Self::ENCODED_LEN,
31538 __tmp.remaining(),
31539 )
31540 }
31541 __tmp.put_u64_le(self.usec);
31542 __tmp.put_f32_le(self.x);
31543 __tmp.put_f32_le(self.y);
31544 __tmp.put_f32_le(self.z);
31545 __tmp.put_f32_le(self.roll);
31546 __tmp.put_f32_le(self.pitch);
31547 __tmp.put_f32_le(self.yaw);
31548 for val in &self.covariance {
31549 __tmp.put_f32_le(*val);
31550 }
31551 if matches!(version, MavlinkVersion::V2) {
31552 let len = __tmp.len();
31553 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31554 } else {
31555 __tmp.len()
31556 }
31557 }
31558}
31559#[doc = "id: 269"]
31560#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
31561#[derive(Debug, Clone, PartialEq)]
31562#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31563#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31564pub struct VIDEO_STREAM_INFORMATION_DATA {
31565 #[doc = "Frame rate."]
31566 pub framerate: f32,
31567 #[doc = "Bit rate."]
31568 pub bitrate: u32,
31569 #[doc = "Bitmap of stream status flags."]
31570 pub flags: VideoStreamStatusFlags,
31571 #[doc = "Horizontal resolution."]
31572 pub resolution_h: u16,
31573 #[doc = "Vertical resolution."]
31574 pub resolution_v: u16,
31575 #[doc = "Video image rotation clockwise."]
31576 pub rotation: u16,
31577 #[doc = "Horizontal Field of view."]
31578 pub hfov: u16,
31579 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31580 pub stream_id: u8,
31581 #[doc = "Number of streams available."]
31582 pub count: u8,
31583 #[doc = "Type of stream."]
31584 pub mavtype: VideoStreamType,
31585 #[doc = "Stream name."]
31586 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31587 pub name: [u8; 32],
31588 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
31589 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31590 pub uri: [u8; 160],
31591 #[doc = "Encoding of stream."]
31592 #[cfg_attr(feature = "serde", serde(default))]
31593 pub encoding: VideoStreamEncoding,
31594 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31595 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31596 pub camera_device_id: u8,
31597}
31598impl VIDEO_STREAM_INFORMATION_DATA {
31599 pub const ENCODED_LEN: usize = 215usize;
31600 pub const DEFAULT: Self = Self {
31601 framerate: 0.0_f32,
31602 bitrate: 0_u32,
31603 flags: VideoStreamStatusFlags::DEFAULT,
31604 resolution_h: 0_u16,
31605 resolution_v: 0_u16,
31606 rotation: 0_u16,
31607 hfov: 0_u16,
31608 stream_id: 0_u8,
31609 count: 0_u8,
31610 mavtype: VideoStreamType::DEFAULT,
31611 name: [0_u8; 32usize],
31612 uri: [0_u8; 160usize],
31613 encoding: VideoStreamEncoding::DEFAULT,
31614 camera_device_id: 0_u8,
31615 };
31616 #[cfg(feature = "arbitrary")]
31617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31618 use arbitrary::{Arbitrary, Unstructured};
31619 let mut buf = [0u8; 1024];
31620 rng.fill_bytes(&mut buf);
31621 let mut unstructured = Unstructured::new(&buf);
31622 Self::arbitrary(&mut unstructured).unwrap_or_default()
31623 }
31624}
31625impl Default for VIDEO_STREAM_INFORMATION_DATA {
31626 fn default() -> Self {
31627 Self::DEFAULT.clone()
31628 }
31629}
31630impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
31631 type Message = MavMessage;
31632 const ID: u32 = 269u32;
31633 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
31634 const EXTRA_CRC: u8 = 109u8;
31635 const ENCODED_LEN: usize = 215usize;
31636 fn deser(
31637 _version: MavlinkVersion,
31638 __input: &[u8],
31639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31640 let avail_len = __input.len();
31641 let mut payload_buf = [0; Self::ENCODED_LEN];
31642 let mut buf = if avail_len < Self::ENCODED_LEN {
31643 payload_buf[0..avail_len].copy_from_slice(__input);
31644 Bytes::new(&payload_buf)
31645 } else {
31646 Bytes::new(__input)
31647 };
31648 let mut __struct = Self::default();
31649 __struct.framerate = buf.get_f32_le();
31650 __struct.bitrate = buf.get_u32_le();
31651 let tmp = buf.get_u16_le();
31652 __struct.flags = VideoStreamStatusFlags::from_bits(
31653 tmp & VideoStreamStatusFlags::all().bits(),
31654 )
31655 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31656 flag_type: "VideoStreamStatusFlags",
31657 value: tmp as u32,
31658 })?;
31659 __struct.resolution_h = buf.get_u16_le();
31660 __struct.resolution_v = buf.get_u16_le();
31661 __struct.rotation = buf.get_u16_le();
31662 __struct.hfov = buf.get_u16_le();
31663 __struct.stream_id = buf.get_u8();
31664 __struct.count = buf.get_u8();
31665 let tmp = buf.get_u8();
31666 __struct.mavtype =
31667 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31668 enum_type: "VideoStreamType",
31669 value: tmp as u32,
31670 })?;
31671 for v in &mut __struct.name {
31672 let val = buf.get_u8();
31673 *v = val;
31674 }
31675 for v in &mut __struct.uri {
31676 let val = buf.get_u8();
31677 *v = val;
31678 }
31679 let tmp = buf.get_u8();
31680 __struct.encoding =
31681 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31682 enum_type: "VideoStreamEncoding",
31683 value: tmp as u32,
31684 })?;
31685 __struct.camera_device_id = buf.get_u8();
31686 Ok(__struct)
31687 }
31688 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31689 let mut __tmp = BytesMut::new(bytes);
31690 #[allow(clippy::absurd_extreme_comparisons)]
31691 #[allow(unused_comparisons)]
31692 if __tmp.remaining() < Self::ENCODED_LEN {
31693 panic!(
31694 "buffer is too small (need {} bytes, but got {})",
31695 Self::ENCODED_LEN,
31696 __tmp.remaining(),
31697 )
31698 }
31699 __tmp.put_f32_le(self.framerate);
31700 __tmp.put_u32_le(self.bitrate);
31701 __tmp.put_u16_le(self.flags.bits());
31702 __tmp.put_u16_le(self.resolution_h);
31703 __tmp.put_u16_le(self.resolution_v);
31704 __tmp.put_u16_le(self.rotation);
31705 __tmp.put_u16_le(self.hfov);
31706 __tmp.put_u8(self.stream_id);
31707 __tmp.put_u8(self.count);
31708 __tmp.put_u8(self.mavtype as u8);
31709 for val in &self.name {
31710 __tmp.put_u8(*val);
31711 }
31712 for val in &self.uri {
31713 __tmp.put_u8(*val);
31714 }
31715 __tmp.put_u8(self.encoding as u8);
31716 __tmp.put_u8(self.camera_device_id);
31717 if matches!(version, MavlinkVersion::V2) {
31718 let len = __tmp.len();
31719 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31720 } else {
31721 __tmp.len()
31722 }
31723 }
31724}
31725#[doc = "id: 270"]
31726#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
31727#[derive(Debug, Clone, PartialEq)]
31728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31729#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31730pub struct VIDEO_STREAM_STATUS_DATA {
31731 #[doc = "Frame rate"]
31732 pub framerate: f32,
31733 #[doc = "Bit rate"]
31734 pub bitrate: u32,
31735 #[doc = "Bitmap of stream status flags"]
31736 pub flags: VideoStreamStatusFlags,
31737 #[doc = "Horizontal resolution"]
31738 pub resolution_h: u16,
31739 #[doc = "Vertical resolution"]
31740 pub resolution_v: u16,
31741 #[doc = "Video image rotation clockwise"]
31742 pub rotation: u16,
31743 #[doc = "Horizontal Field of view"]
31744 pub hfov: u16,
31745 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31746 pub stream_id: u8,
31747 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31748 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31749 pub camera_device_id: u8,
31750}
31751impl VIDEO_STREAM_STATUS_DATA {
31752 pub const ENCODED_LEN: usize = 20usize;
31753 pub const DEFAULT: Self = Self {
31754 framerate: 0.0_f32,
31755 bitrate: 0_u32,
31756 flags: VideoStreamStatusFlags::DEFAULT,
31757 resolution_h: 0_u16,
31758 resolution_v: 0_u16,
31759 rotation: 0_u16,
31760 hfov: 0_u16,
31761 stream_id: 0_u8,
31762 camera_device_id: 0_u8,
31763 };
31764 #[cfg(feature = "arbitrary")]
31765 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31766 use arbitrary::{Arbitrary, Unstructured};
31767 let mut buf = [0u8; 1024];
31768 rng.fill_bytes(&mut buf);
31769 let mut unstructured = Unstructured::new(&buf);
31770 Self::arbitrary(&mut unstructured).unwrap_or_default()
31771 }
31772}
31773impl Default for VIDEO_STREAM_STATUS_DATA {
31774 fn default() -> Self {
31775 Self::DEFAULT.clone()
31776 }
31777}
31778impl MessageData for VIDEO_STREAM_STATUS_DATA {
31779 type Message = MavMessage;
31780 const ID: u32 = 270u32;
31781 const NAME: &'static str = "VIDEO_STREAM_STATUS";
31782 const EXTRA_CRC: u8 = 59u8;
31783 const ENCODED_LEN: usize = 20usize;
31784 fn deser(
31785 _version: MavlinkVersion,
31786 __input: &[u8],
31787 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31788 let avail_len = __input.len();
31789 let mut payload_buf = [0; Self::ENCODED_LEN];
31790 let mut buf = if avail_len < Self::ENCODED_LEN {
31791 payload_buf[0..avail_len].copy_from_slice(__input);
31792 Bytes::new(&payload_buf)
31793 } else {
31794 Bytes::new(__input)
31795 };
31796 let mut __struct = Self::default();
31797 __struct.framerate = buf.get_f32_le();
31798 __struct.bitrate = buf.get_u32_le();
31799 let tmp = buf.get_u16_le();
31800 __struct.flags = VideoStreamStatusFlags::from_bits(
31801 tmp & VideoStreamStatusFlags::all().bits(),
31802 )
31803 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31804 flag_type: "VideoStreamStatusFlags",
31805 value: tmp as u32,
31806 })?;
31807 __struct.resolution_h = buf.get_u16_le();
31808 __struct.resolution_v = buf.get_u16_le();
31809 __struct.rotation = buf.get_u16_le();
31810 __struct.hfov = buf.get_u16_le();
31811 __struct.stream_id = buf.get_u8();
31812 __struct.camera_device_id = buf.get_u8();
31813 Ok(__struct)
31814 }
31815 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31816 let mut __tmp = BytesMut::new(bytes);
31817 #[allow(clippy::absurd_extreme_comparisons)]
31818 #[allow(unused_comparisons)]
31819 if __tmp.remaining() < Self::ENCODED_LEN {
31820 panic!(
31821 "buffer is too small (need {} bytes, but got {})",
31822 Self::ENCODED_LEN,
31823 __tmp.remaining(),
31824 )
31825 }
31826 __tmp.put_f32_le(self.framerate);
31827 __tmp.put_u32_le(self.bitrate);
31828 __tmp.put_u16_le(self.flags.bits());
31829 __tmp.put_u16_le(self.resolution_h);
31830 __tmp.put_u16_le(self.resolution_v);
31831 __tmp.put_u16_le(self.rotation);
31832 __tmp.put_u16_le(self.hfov);
31833 __tmp.put_u8(self.stream_id);
31834 __tmp.put_u8(self.camera_device_id);
31835 if matches!(version, MavlinkVersion::V2) {
31836 let len = __tmp.len();
31837 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31838 } else {
31839 __tmp.len()
31840 }
31841 }
31842}
31843#[doc = "id: 102"]
31844#[doc = "Local position/attitude estimate from a vision source."]
31845#[derive(Debug, Clone, PartialEq)]
31846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31847#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31848pub struct VISION_POSITION_ESTIMATE_DATA {
31849 #[doc = "Timestamp (UNIX time or time since system boot)"]
31850 pub usec: u64,
31851 #[doc = "Local X position"]
31852 pub x: f32,
31853 #[doc = "Local Y position"]
31854 pub y: f32,
31855 #[doc = "Local Z position"]
31856 pub z: f32,
31857 #[doc = "Roll angle"]
31858 pub roll: f32,
31859 #[doc = "Pitch angle"]
31860 pub pitch: f32,
31861 #[doc = "Yaw angle"]
31862 pub yaw: f32,
31863 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31864 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31865 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31866 pub covariance: [f32; 21],
31867 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31868 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31869 pub reset_counter: u8,
31870}
31871impl VISION_POSITION_ESTIMATE_DATA {
31872 pub const ENCODED_LEN: usize = 117usize;
31873 pub const DEFAULT: Self = Self {
31874 usec: 0_u64,
31875 x: 0.0_f32,
31876 y: 0.0_f32,
31877 z: 0.0_f32,
31878 roll: 0.0_f32,
31879 pitch: 0.0_f32,
31880 yaw: 0.0_f32,
31881 covariance: [0.0_f32; 21usize],
31882 reset_counter: 0_u8,
31883 };
31884 #[cfg(feature = "arbitrary")]
31885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31886 use arbitrary::{Arbitrary, Unstructured};
31887 let mut buf = [0u8; 1024];
31888 rng.fill_bytes(&mut buf);
31889 let mut unstructured = Unstructured::new(&buf);
31890 Self::arbitrary(&mut unstructured).unwrap_or_default()
31891 }
31892}
31893impl Default for VISION_POSITION_ESTIMATE_DATA {
31894 fn default() -> Self {
31895 Self::DEFAULT.clone()
31896 }
31897}
31898impl MessageData for VISION_POSITION_ESTIMATE_DATA {
31899 type Message = MavMessage;
31900 const ID: u32 = 102u32;
31901 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
31902 const EXTRA_CRC: u8 = 158u8;
31903 const ENCODED_LEN: usize = 117usize;
31904 fn deser(
31905 _version: MavlinkVersion,
31906 __input: &[u8],
31907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31908 let avail_len = __input.len();
31909 let mut payload_buf = [0; Self::ENCODED_LEN];
31910 let mut buf = if avail_len < Self::ENCODED_LEN {
31911 payload_buf[0..avail_len].copy_from_slice(__input);
31912 Bytes::new(&payload_buf)
31913 } else {
31914 Bytes::new(__input)
31915 };
31916 let mut __struct = Self::default();
31917 __struct.usec = buf.get_u64_le();
31918 __struct.x = buf.get_f32_le();
31919 __struct.y = buf.get_f32_le();
31920 __struct.z = buf.get_f32_le();
31921 __struct.roll = buf.get_f32_le();
31922 __struct.pitch = buf.get_f32_le();
31923 __struct.yaw = buf.get_f32_le();
31924 for v in &mut __struct.covariance {
31925 let val = buf.get_f32_le();
31926 *v = val;
31927 }
31928 __struct.reset_counter = buf.get_u8();
31929 Ok(__struct)
31930 }
31931 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31932 let mut __tmp = BytesMut::new(bytes);
31933 #[allow(clippy::absurd_extreme_comparisons)]
31934 #[allow(unused_comparisons)]
31935 if __tmp.remaining() < Self::ENCODED_LEN {
31936 panic!(
31937 "buffer is too small (need {} bytes, but got {})",
31938 Self::ENCODED_LEN,
31939 __tmp.remaining(),
31940 )
31941 }
31942 __tmp.put_u64_le(self.usec);
31943 __tmp.put_f32_le(self.x);
31944 __tmp.put_f32_le(self.y);
31945 __tmp.put_f32_le(self.z);
31946 __tmp.put_f32_le(self.roll);
31947 __tmp.put_f32_le(self.pitch);
31948 __tmp.put_f32_le(self.yaw);
31949 for val in &self.covariance {
31950 __tmp.put_f32_le(*val);
31951 }
31952 __tmp.put_u8(self.reset_counter);
31953 if matches!(version, MavlinkVersion::V2) {
31954 let len = __tmp.len();
31955 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31956 } else {
31957 __tmp.len()
31958 }
31959 }
31960}
31961#[doc = "id: 103"]
31962#[doc = "Speed estimate from a vision source."]
31963#[derive(Debug, Clone, PartialEq)]
31964#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31966pub struct VISION_SPEED_ESTIMATE_DATA {
31967 #[doc = "Timestamp (UNIX time or time since system boot)"]
31968 pub usec: u64,
31969 #[doc = "Global X speed"]
31970 pub x: f32,
31971 #[doc = "Global Y speed"]
31972 pub y: f32,
31973 #[doc = "Global Z speed"]
31974 pub z: f32,
31975 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
31976 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31977 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31978 pub covariance: [f32; 9],
31979 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31980 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31981 pub reset_counter: u8,
31982}
31983impl VISION_SPEED_ESTIMATE_DATA {
31984 pub const ENCODED_LEN: usize = 57usize;
31985 pub const DEFAULT: Self = Self {
31986 usec: 0_u64,
31987 x: 0.0_f32,
31988 y: 0.0_f32,
31989 z: 0.0_f32,
31990 covariance: [0.0_f32; 9usize],
31991 reset_counter: 0_u8,
31992 };
31993 #[cfg(feature = "arbitrary")]
31994 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31995 use arbitrary::{Arbitrary, Unstructured};
31996 let mut buf = [0u8; 1024];
31997 rng.fill_bytes(&mut buf);
31998 let mut unstructured = Unstructured::new(&buf);
31999 Self::arbitrary(&mut unstructured).unwrap_or_default()
32000 }
32001}
32002impl Default for VISION_SPEED_ESTIMATE_DATA {
32003 fn default() -> Self {
32004 Self::DEFAULT.clone()
32005 }
32006}
32007impl MessageData for VISION_SPEED_ESTIMATE_DATA {
32008 type Message = MavMessage;
32009 const ID: u32 = 103u32;
32010 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
32011 const EXTRA_CRC: u8 = 208u8;
32012 const ENCODED_LEN: usize = 57usize;
32013 fn deser(
32014 _version: MavlinkVersion,
32015 __input: &[u8],
32016 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32017 let avail_len = __input.len();
32018 let mut payload_buf = [0; Self::ENCODED_LEN];
32019 let mut buf = if avail_len < Self::ENCODED_LEN {
32020 payload_buf[0..avail_len].copy_from_slice(__input);
32021 Bytes::new(&payload_buf)
32022 } else {
32023 Bytes::new(__input)
32024 };
32025 let mut __struct = Self::default();
32026 __struct.usec = buf.get_u64_le();
32027 __struct.x = buf.get_f32_le();
32028 __struct.y = buf.get_f32_le();
32029 __struct.z = buf.get_f32_le();
32030 for v in &mut __struct.covariance {
32031 let val = buf.get_f32_le();
32032 *v = val;
32033 }
32034 __struct.reset_counter = buf.get_u8();
32035 Ok(__struct)
32036 }
32037 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32038 let mut __tmp = BytesMut::new(bytes);
32039 #[allow(clippy::absurd_extreme_comparisons)]
32040 #[allow(unused_comparisons)]
32041 if __tmp.remaining() < Self::ENCODED_LEN {
32042 panic!(
32043 "buffer is too small (need {} bytes, but got {})",
32044 Self::ENCODED_LEN,
32045 __tmp.remaining(),
32046 )
32047 }
32048 __tmp.put_u64_le(self.usec);
32049 __tmp.put_f32_le(self.x);
32050 __tmp.put_f32_le(self.y);
32051 __tmp.put_f32_le(self.z);
32052 for val in &self.covariance {
32053 __tmp.put_f32_le(*val);
32054 }
32055 __tmp.put_u8(self.reset_counter);
32056 if matches!(version, MavlinkVersion::V2) {
32057 let len = __tmp.len();
32058 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32059 } else {
32060 __tmp.len()
32061 }
32062 }
32063}
32064#[doc = "id: 9000"]
32065#[doc = "Cumulative distance traveled for each reported wheel."]
32066#[derive(Debug, Clone, PartialEq)]
32067#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32068#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32069pub struct WHEEL_DISTANCE_DATA {
32070 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32071 pub time_usec: u64,
32072 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
32073 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32074 pub distance: [f64; 16],
32075 #[doc = "Number of wheels reported."]
32076 pub count: u8,
32077}
32078impl WHEEL_DISTANCE_DATA {
32079 pub const ENCODED_LEN: usize = 137usize;
32080 pub const DEFAULT: Self = Self {
32081 time_usec: 0_u64,
32082 distance: [0.0_f64; 16usize],
32083 count: 0_u8,
32084 };
32085 #[cfg(feature = "arbitrary")]
32086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32087 use arbitrary::{Arbitrary, Unstructured};
32088 let mut buf = [0u8; 1024];
32089 rng.fill_bytes(&mut buf);
32090 let mut unstructured = Unstructured::new(&buf);
32091 Self::arbitrary(&mut unstructured).unwrap_or_default()
32092 }
32093}
32094impl Default for WHEEL_DISTANCE_DATA {
32095 fn default() -> Self {
32096 Self::DEFAULT.clone()
32097 }
32098}
32099impl MessageData for WHEEL_DISTANCE_DATA {
32100 type Message = MavMessage;
32101 const ID: u32 = 9000u32;
32102 const NAME: &'static str = "WHEEL_DISTANCE";
32103 const EXTRA_CRC: u8 = 113u8;
32104 const ENCODED_LEN: usize = 137usize;
32105 fn deser(
32106 _version: MavlinkVersion,
32107 __input: &[u8],
32108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32109 let avail_len = __input.len();
32110 let mut payload_buf = [0; Self::ENCODED_LEN];
32111 let mut buf = if avail_len < Self::ENCODED_LEN {
32112 payload_buf[0..avail_len].copy_from_slice(__input);
32113 Bytes::new(&payload_buf)
32114 } else {
32115 Bytes::new(__input)
32116 };
32117 let mut __struct = Self::default();
32118 __struct.time_usec = buf.get_u64_le();
32119 for v in &mut __struct.distance {
32120 let val = buf.get_f64_le();
32121 *v = val;
32122 }
32123 __struct.count = buf.get_u8();
32124 Ok(__struct)
32125 }
32126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32127 let mut __tmp = BytesMut::new(bytes);
32128 #[allow(clippy::absurd_extreme_comparisons)]
32129 #[allow(unused_comparisons)]
32130 if __tmp.remaining() < Self::ENCODED_LEN {
32131 panic!(
32132 "buffer is too small (need {} bytes, but got {})",
32133 Self::ENCODED_LEN,
32134 __tmp.remaining(),
32135 )
32136 }
32137 __tmp.put_u64_le(self.time_usec);
32138 for val in &self.distance {
32139 __tmp.put_f64_le(*val);
32140 }
32141 __tmp.put_u8(self.count);
32142 if matches!(version, MavlinkVersion::V2) {
32143 let len = __tmp.len();
32144 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32145 } else {
32146 __tmp.len()
32147 }
32148 }
32149}
32150#[doc = "id: 299"]
32151#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32152#[derive(Debug, Clone, PartialEq)]
32153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32155pub struct WIFI_CONFIG_AP_DATA {
32156 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
32157 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32158 pub ssid: [u8; 32],
32159 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
32160 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32161 pub password: [u8; 64],
32162 #[doc = "WiFi Mode."]
32163 #[cfg_attr(feature = "serde", serde(default))]
32164 pub mode: WifiConfigApMode,
32165 #[doc = "Message acceptance response (sent back to GS)."]
32166 #[cfg_attr(feature = "serde", serde(default))]
32167 pub response: WifiConfigApResponse,
32168}
32169impl WIFI_CONFIG_AP_DATA {
32170 pub const ENCODED_LEN: usize = 98usize;
32171 pub const DEFAULT: Self = Self {
32172 ssid: [0_u8; 32usize],
32173 password: [0_u8; 64usize],
32174 mode: WifiConfigApMode::DEFAULT,
32175 response: WifiConfigApResponse::DEFAULT,
32176 };
32177 #[cfg(feature = "arbitrary")]
32178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32179 use arbitrary::{Arbitrary, Unstructured};
32180 let mut buf = [0u8; 1024];
32181 rng.fill_bytes(&mut buf);
32182 let mut unstructured = Unstructured::new(&buf);
32183 Self::arbitrary(&mut unstructured).unwrap_or_default()
32184 }
32185}
32186impl Default for WIFI_CONFIG_AP_DATA {
32187 fn default() -> Self {
32188 Self::DEFAULT.clone()
32189 }
32190}
32191impl MessageData for WIFI_CONFIG_AP_DATA {
32192 type Message = MavMessage;
32193 const ID: u32 = 299u32;
32194 const NAME: &'static str = "WIFI_CONFIG_AP";
32195 const EXTRA_CRC: u8 = 19u8;
32196 const ENCODED_LEN: usize = 98usize;
32197 fn deser(
32198 _version: MavlinkVersion,
32199 __input: &[u8],
32200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32201 let avail_len = __input.len();
32202 let mut payload_buf = [0; Self::ENCODED_LEN];
32203 let mut buf = if avail_len < Self::ENCODED_LEN {
32204 payload_buf[0..avail_len].copy_from_slice(__input);
32205 Bytes::new(&payload_buf)
32206 } else {
32207 Bytes::new(__input)
32208 };
32209 let mut __struct = Self::default();
32210 for v in &mut __struct.ssid {
32211 let val = buf.get_u8();
32212 *v = val;
32213 }
32214 for v in &mut __struct.password {
32215 let val = buf.get_u8();
32216 *v = val;
32217 }
32218 let tmp = buf.get_i8();
32219 __struct.mode =
32220 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32221 enum_type: "WifiConfigApMode",
32222 value: tmp as u32,
32223 })?;
32224 let tmp = buf.get_i8();
32225 __struct.response =
32226 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32227 enum_type: "WifiConfigApResponse",
32228 value: tmp as u32,
32229 })?;
32230 Ok(__struct)
32231 }
32232 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32233 let mut __tmp = BytesMut::new(bytes);
32234 #[allow(clippy::absurd_extreme_comparisons)]
32235 #[allow(unused_comparisons)]
32236 if __tmp.remaining() < Self::ENCODED_LEN {
32237 panic!(
32238 "buffer is too small (need {} bytes, but got {})",
32239 Self::ENCODED_LEN,
32240 __tmp.remaining(),
32241 )
32242 }
32243 for val in &self.ssid {
32244 __tmp.put_u8(*val);
32245 }
32246 for val in &self.password {
32247 __tmp.put_u8(*val);
32248 }
32249 __tmp.put_i8(self.mode as i8);
32250 __tmp.put_i8(self.response as i8);
32251 if matches!(version, MavlinkVersion::V2) {
32252 let len = __tmp.len();
32253 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32254 } else {
32255 __tmp.len()
32256 }
32257 }
32258}
32259#[doc = "id: 9005"]
32260#[doc = "Winch status."]
32261#[derive(Debug, Clone, PartialEq)]
32262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32263#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32264pub struct WINCH_STATUS_DATA {
32265 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32266 pub time_usec: u64,
32267 #[doc = "Length of line released. NaN if unknown"]
32268 pub line_length: f32,
32269 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
32270 pub speed: f32,
32271 #[doc = "Tension on the line. NaN if unknown"]
32272 pub tension: f32,
32273 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
32274 pub voltage: f32,
32275 #[doc = "Current draw from the winch. NaN if unknown"]
32276 pub current: f32,
32277 #[doc = "Status flags"]
32278 pub status: MavWinchStatusFlag,
32279 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
32280 pub temperature: i16,
32281}
32282impl WINCH_STATUS_DATA {
32283 pub const ENCODED_LEN: usize = 34usize;
32284 pub const DEFAULT: Self = Self {
32285 time_usec: 0_u64,
32286 line_length: 0.0_f32,
32287 speed: 0.0_f32,
32288 tension: 0.0_f32,
32289 voltage: 0.0_f32,
32290 current: 0.0_f32,
32291 status: MavWinchStatusFlag::DEFAULT,
32292 temperature: 0_i16,
32293 };
32294 #[cfg(feature = "arbitrary")]
32295 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32296 use arbitrary::{Arbitrary, Unstructured};
32297 let mut buf = [0u8; 1024];
32298 rng.fill_bytes(&mut buf);
32299 let mut unstructured = Unstructured::new(&buf);
32300 Self::arbitrary(&mut unstructured).unwrap_or_default()
32301 }
32302}
32303impl Default for WINCH_STATUS_DATA {
32304 fn default() -> Self {
32305 Self::DEFAULT.clone()
32306 }
32307}
32308impl MessageData for WINCH_STATUS_DATA {
32309 type Message = MavMessage;
32310 const ID: u32 = 9005u32;
32311 const NAME: &'static str = "WINCH_STATUS";
32312 const EXTRA_CRC: u8 = 117u8;
32313 const ENCODED_LEN: usize = 34usize;
32314 fn deser(
32315 _version: MavlinkVersion,
32316 __input: &[u8],
32317 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32318 let avail_len = __input.len();
32319 let mut payload_buf = [0; Self::ENCODED_LEN];
32320 let mut buf = if avail_len < Self::ENCODED_LEN {
32321 payload_buf[0..avail_len].copy_from_slice(__input);
32322 Bytes::new(&payload_buf)
32323 } else {
32324 Bytes::new(__input)
32325 };
32326 let mut __struct = Self::default();
32327 __struct.time_usec = buf.get_u64_le();
32328 __struct.line_length = buf.get_f32_le();
32329 __struct.speed = buf.get_f32_le();
32330 __struct.tension = buf.get_f32_le();
32331 __struct.voltage = buf.get_f32_le();
32332 __struct.current = buf.get_f32_le();
32333 let tmp = buf.get_u32_le();
32334 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
32335 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32336 flag_type: "MavWinchStatusFlag",
32337 value: tmp as u32,
32338 })?;
32339 __struct.temperature = buf.get_i16_le();
32340 Ok(__struct)
32341 }
32342 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32343 let mut __tmp = BytesMut::new(bytes);
32344 #[allow(clippy::absurd_extreme_comparisons)]
32345 #[allow(unused_comparisons)]
32346 if __tmp.remaining() < Self::ENCODED_LEN {
32347 panic!(
32348 "buffer is too small (need {} bytes, but got {})",
32349 Self::ENCODED_LEN,
32350 __tmp.remaining(),
32351 )
32352 }
32353 __tmp.put_u64_le(self.time_usec);
32354 __tmp.put_f32_le(self.line_length);
32355 __tmp.put_f32_le(self.speed);
32356 __tmp.put_f32_le(self.tension);
32357 __tmp.put_f32_le(self.voltage);
32358 __tmp.put_f32_le(self.current);
32359 __tmp.put_u32_le(self.status.bits());
32360 __tmp.put_i16_le(self.temperature);
32361 if matches!(version, MavlinkVersion::V2) {
32362 let len = __tmp.len();
32363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32364 } else {
32365 __tmp.len()
32366 }
32367 }
32368}
32369#[doc = "id: 231"]
32370#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32371#[derive(Debug, Clone, PartialEq)]
32372#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32373#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32374pub struct WIND_COV_DATA {
32375 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32376 pub time_usec: u64,
32377 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
32378 pub wind_x: f32,
32379 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
32380 pub wind_y: f32,
32381 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
32382 pub wind_z: f32,
32383 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32384 pub var_horiz: f32,
32385 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32386 pub var_vert: f32,
32387 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
32388 pub wind_alt: f32,
32389 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
32390 pub horiz_accuracy: f32,
32391 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
32392 pub vert_accuracy: f32,
32393}
32394impl WIND_COV_DATA {
32395 pub const ENCODED_LEN: usize = 40usize;
32396 pub const DEFAULT: Self = Self {
32397 time_usec: 0_u64,
32398 wind_x: 0.0_f32,
32399 wind_y: 0.0_f32,
32400 wind_z: 0.0_f32,
32401 var_horiz: 0.0_f32,
32402 var_vert: 0.0_f32,
32403 wind_alt: 0.0_f32,
32404 horiz_accuracy: 0.0_f32,
32405 vert_accuracy: 0.0_f32,
32406 };
32407 #[cfg(feature = "arbitrary")]
32408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32409 use arbitrary::{Arbitrary, Unstructured};
32410 let mut buf = [0u8; 1024];
32411 rng.fill_bytes(&mut buf);
32412 let mut unstructured = Unstructured::new(&buf);
32413 Self::arbitrary(&mut unstructured).unwrap_or_default()
32414 }
32415}
32416impl Default for WIND_COV_DATA {
32417 fn default() -> Self {
32418 Self::DEFAULT.clone()
32419 }
32420}
32421impl MessageData for WIND_COV_DATA {
32422 type Message = MavMessage;
32423 const ID: u32 = 231u32;
32424 const NAME: &'static str = "WIND_COV";
32425 const EXTRA_CRC: u8 = 105u8;
32426 const ENCODED_LEN: usize = 40usize;
32427 fn deser(
32428 _version: MavlinkVersion,
32429 __input: &[u8],
32430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32431 let avail_len = __input.len();
32432 let mut payload_buf = [0; Self::ENCODED_LEN];
32433 let mut buf = if avail_len < Self::ENCODED_LEN {
32434 payload_buf[0..avail_len].copy_from_slice(__input);
32435 Bytes::new(&payload_buf)
32436 } else {
32437 Bytes::new(__input)
32438 };
32439 let mut __struct = Self::default();
32440 __struct.time_usec = buf.get_u64_le();
32441 __struct.wind_x = buf.get_f32_le();
32442 __struct.wind_y = buf.get_f32_le();
32443 __struct.wind_z = buf.get_f32_le();
32444 __struct.var_horiz = buf.get_f32_le();
32445 __struct.var_vert = buf.get_f32_le();
32446 __struct.wind_alt = buf.get_f32_le();
32447 __struct.horiz_accuracy = buf.get_f32_le();
32448 __struct.vert_accuracy = buf.get_f32_le();
32449 Ok(__struct)
32450 }
32451 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32452 let mut __tmp = BytesMut::new(bytes);
32453 #[allow(clippy::absurd_extreme_comparisons)]
32454 #[allow(unused_comparisons)]
32455 if __tmp.remaining() < Self::ENCODED_LEN {
32456 panic!(
32457 "buffer is too small (need {} bytes, but got {})",
32458 Self::ENCODED_LEN,
32459 __tmp.remaining(),
32460 )
32461 }
32462 __tmp.put_u64_le(self.time_usec);
32463 __tmp.put_f32_le(self.wind_x);
32464 __tmp.put_f32_le(self.wind_y);
32465 __tmp.put_f32_le(self.wind_z);
32466 __tmp.put_f32_le(self.var_horiz);
32467 __tmp.put_f32_le(self.var_vert);
32468 __tmp.put_f32_le(self.wind_alt);
32469 __tmp.put_f32_le(self.horiz_accuracy);
32470 __tmp.put_f32_le(self.vert_accuracy);
32471 if matches!(version, MavlinkVersion::V2) {
32472 let len = __tmp.len();
32473 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32474 } else {
32475 __tmp.len()
32476 }
32477 }
32478}
32479#[derive(Clone, PartialEq, Debug)]
32480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32481#[cfg_attr(feature = "serde", serde(tag = "type"))]
32482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32483#[repr(u32)]
32484pub enum MavMessage {
32485 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
32486 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
32487 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
32488 AIRSPEED(AIRSPEED_DATA),
32489 AIS_VESSEL(AIS_VESSEL_DATA),
32490 ALTITUDE(ALTITUDE_DATA),
32491 ATTITUDE(ATTITUDE_DATA),
32492 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
32493 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
32494 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
32495 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
32496 AUTH_KEY(AUTH_KEY_DATA),
32497 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
32498 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
32499 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
32500 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
32501 BATTERY_INFO(BATTERY_INFO_DATA),
32502 BATTERY_STATUS(BATTERY_STATUS_DATA),
32503 BATTERY_STATUS_V2(BATTERY_STATUS_V2_DATA),
32504 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
32505 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
32506 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
32507 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
32508 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
32509 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
32510 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
32511 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
32512 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
32513 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
32514 CANFD_FRAME(CANFD_FRAME_DATA),
32515 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
32516 CAN_FRAME(CAN_FRAME_DATA),
32517 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
32518 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
32519 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
32520 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
32521 COLLISION(COLLISION_DATA),
32522 COMMAND_ACK(COMMAND_ACK_DATA),
32523 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
32524 COMMAND_INT(COMMAND_INT_DATA),
32525 COMMAND_LONG(COMMAND_LONG_DATA),
32526 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
32527 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
32528 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
32529 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
32530 CONTROL_STATUS(CONTROL_STATUS_DATA),
32531 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
32532 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
32533 CURRENT_MODE(CURRENT_MODE_DATA),
32534 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
32535 DATA_STREAM(DATA_STREAM_DATA),
32536 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
32537 DEBUG(DEBUG_DATA),
32538 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
32539 DEBUG_VECT(DEBUG_VECT_DATA),
32540 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
32541 EFI_STATUS(EFI_STATUS_DATA),
32542 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
32543 ESC_INFO(ESC_INFO_DATA),
32544 ESC_STATUS(ESC_STATUS_DATA),
32545 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
32546 EVENT(EVENT_DATA),
32547 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
32548 FENCE_STATUS(FENCE_STATUS_DATA),
32549 FIGURE_EIGHT_EXECUTION_STATUS(FIGURE_EIGHT_EXECUTION_STATUS_DATA),
32550 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
32551 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
32552 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
32553 FUEL_STATUS(FUEL_STATUS_DATA),
32554 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
32555 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
32556 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
32557 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
32558 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
32559 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
32560 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
32561 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
32562 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
32563 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
32564 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
32565 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
32566 GNSS_INTEGRITY(GNSS_INTEGRITY_DATA),
32567 GPS2_RAW(GPS2_RAW_DATA),
32568 GPS2_RTK(GPS2_RTK_DATA),
32569 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
32570 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
32571 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
32572 GPS_INPUT(GPS_INPUT_DATA),
32573 GPS_RAW_INT(GPS_RAW_INT_DATA),
32574 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
32575 GPS_RTK(GPS_RTK_DATA),
32576 GPS_STATUS(GPS_STATUS_DATA),
32577 GROUP_END(GROUP_END_DATA),
32578 GROUP_START(GROUP_START_DATA),
32579 HEARTBEAT(HEARTBEAT_DATA),
32580 HIGHRES_IMU(HIGHRES_IMU_DATA),
32581 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
32582 HIGH_LATENCY(HIGH_LATENCY_DATA),
32583 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
32584 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
32585 HIL_CONTROLS(HIL_CONTROLS_DATA),
32586 HIL_GPS(HIL_GPS_DATA),
32587 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
32588 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
32589 HIL_SENSOR(HIL_SENSOR_DATA),
32590 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
32591 HIL_STATE(HIL_STATE_DATA),
32592 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
32593 HOME_POSITION(HOME_POSITION_DATA),
32594 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
32595 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
32596 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
32597 LANDING_TARGET(LANDING_TARGET_DATA),
32598 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
32599 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
32600 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
32601 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
32602 LOGGING_ACK(LOGGING_ACK_DATA),
32603 LOGGING_DATA(LOGGING_DATA_DATA),
32604 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
32605 LOG_DATA(LOG_DATA_DATA),
32606 LOG_ENTRY(LOG_ENTRY_DATA),
32607 LOG_ERASE(LOG_ERASE_DATA),
32608 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
32609 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
32610 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
32611 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
32612 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
32613 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
32614 MEMORY_VECT(MEMORY_VECT_DATA),
32615 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
32616 MISSION_ACK(MISSION_ACK_DATA),
32617 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
32618 MISSION_COUNT(MISSION_COUNT_DATA),
32619 MISSION_CURRENT(MISSION_CURRENT_DATA),
32620 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
32621 MISSION_ITEM(MISSION_ITEM_DATA),
32622 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
32623 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
32624 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
32625 MISSION_REQUEST(MISSION_REQUEST_DATA),
32626 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
32627 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
32628 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
32629 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
32630 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
32631 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
32632 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
32633 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
32634 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
32635 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
32636 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
32637 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
32638 ODOMETRY(ODOMETRY_DATA),
32639 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
32640 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
32641 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
32642 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
32643 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
32644 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
32645 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
32646 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
32647 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
32648 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
32649 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
32650 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
32651 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
32652 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
32653 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
32654 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
32655 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
32656 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
32657 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
32658 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
32659 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
32660 PARAM_SET(PARAM_SET_DATA),
32661 PARAM_VALUE(PARAM_VALUE_DATA),
32662 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
32663 PING(PING_DATA),
32664 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
32665 PLAY_TUNE(PLAY_TUNE_DATA),
32666 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
32667 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
32668 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
32669 POWER_STATUS(POWER_STATUS_DATA),
32670 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
32671 RADIO_RC_CHANNELS(RADIO_RC_CHANNELS_DATA),
32672 RADIO_STATUS(RADIO_STATUS_DATA),
32673 RAW_IMU(RAW_IMU_DATA),
32674 RAW_PRESSURE(RAW_PRESSURE_DATA),
32675 RAW_RPM(RAW_RPM_DATA),
32676 RC_CHANNELS(RC_CHANNELS_DATA),
32677 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
32678 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
32679 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
32680 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
32681 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
32682 REQUEST_EVENT(REQUEST_EVENT_DATA),
32683 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
32684 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
32685 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
32686 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
32687 SCALED_IMU(SCALED_IMU_DATA),
32688 SCALED_IMU2(SCALED_IMU2_DATA),
32689 SCALED_IMU3(SCALED_IMU3_DATA),
32690 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
32691 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
32692 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
32693 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
32694 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
32695 SETUP_SIGNING(SETUP_SIGNING_DATA),
32696 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
32697 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
32698 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
32699 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
32700 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
32701 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
32702 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
32703 SET_MODE(SET_MODE_DATA),
32704 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
32705 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
32706 SET_VELOCITY_LIMITS(SET_VELOCITY_LIMITS_DATA),
32707 SIM_STATE(SIM_STATE_DATA),
32708 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
32709 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
32710 STATUSTEXT(STATUSTEXT_DATA),
32711 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
32712 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
32713 SYSTEM_TIME(SYSTEM_TIME_DATA),
32714 SYS_STATUS(SYS_STATUS_DATA),
32715 TARGET_ABSOLUTE(TARGET_ABSOLUTE_DATA),
32716 TARGET_RELATIVE(TARGET_RELATIVE_DATA),
32717 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
32718 TERRAIN_DATA(TERRAIN_DATA_DATA),
32719 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
32720 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
32721 TIMESYNC(TIMESYNC_DATA),
32722 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
32723 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
32724 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
32725 TUNNEL(TUNNEL_DATA),
32726 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
32727 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
32728 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
32729 V2_EXTENSION(V2_EXTENSION_DATA),
32730 VELOCITY_LIMITS(VELOCITY_LIMITS_DATA),
32731 VFR_HUD(VFR_HUD_DATA),
32732 VIBRATION(VIBRATION_DATA),
32733 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
32734 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
32735 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
32736 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
32737 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
32738 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
32739 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
32740 WINCH_STATUS(WINCH_STATUS_DATA),
32741 WIND_COV(WIND_COV_DATA),
32742}
32743impl MavMessage {
32744 pub const fn all_ids() -> &'static [u32] {
32745 &[
32746 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
32747 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
32748 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
32749 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
32750 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
32751 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
32752 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
32753 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
32754 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
32755 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
32756 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
32757 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
32758 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
32759 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
32760 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
32761 295u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32,
32762 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 354u32,
32763 355u32, 360u32, 361u32, 369u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32,
32764 386u32, 387u32, 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32,
32765 412u32, 413u32, 414u32, 415u32, 420u32, 435u32, 436u32, 437u32, 440u32, 441u32, 510u32,
32766 511u32, 512u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32,
32767 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
32768 ]
32769 }
32770}
32771impl Message for MavMessage {
32772 fn parse(
32773 version: MavlinkVersion,
32774 id: u32,
32775 payload: &[u8],
32776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32777 match id {
32778 ACTUATOR_CONTROL_TARGET_DATA::ID => {
32779 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
32780 .map(Self::ACTUATOR_CONTROL_TARGET)
32781 }
32782 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
32783 .map(Self::ACTUATOR_OUTPUT_STATUS),
32784 ADSB_VEHICLE_DATA::ID => {
32785 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
32786 }
32787 AIRSPEED_DATA::ID => AIRSPEED_DATA::deser(version, payload).map(Self::AIRSPEED),
32788 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
32789 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
32790 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
32791 ATTITUDE_QUATERNION_DATA::ID => {
32792 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
32793 }
32794 ATTITUDE_QUATERNION_COV_DATA::ID => {
32795 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
32796 .map(Self::ATTITUDE_QUATERNION_COV)
32797 }
32798 ATTITUDE_TARGET_DATA::ID => {
32799 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
32800 }
32801 ATT_POS_MOCAP_DATA::ID => {
32802 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
32803 }
32804 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
32805 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
32806 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
32807 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
32808 }
32809 AUTOPILOT_VERSION_DATA::ID => {
32810 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
32811 }
32812 AVAILABLE_MODES_DATA::ID => {
32813 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
32814 }
32815 AVAILABLE_MODES_MONITOR_DATA::ID => {
32816 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
32817 .map(Self::AVAILABLE_MODES_MONITOR)
32818 }
32819 BATTERY_INFO_DATA::ID => {
32820 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
32821 }
32822 BATTERY_STATUS_DATA::ID => {
32823 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
32824 }
32825 BATTERY_STATUS_V2_DATA::ID => {
32826 BATTERY_STATUS_V2_DATA::deser(version, payload).map(Self::BATTERY_STATUS_V2)
32827 }
32828 BUTTON_CHANGE_DATA::ID => {
32829 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
32830 }
32831 CAMERA_CAPTURE_STATUS_DATA::ID => {
32832 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
32833 }
32834 CAMERA_FOV_STATUS_DATA::ID => {
32835 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
32836 }
32837 CAMERA_IMAGE_CAPTURED_DATA::ID => {
32838 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
32839 }
32840 CAMERA_INFORMATION_DATA::ID => {
32841 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
32842 }
32843 CAMERA_SETTINGS_DATA::ID => {
32844 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
32845 }
32846 CAMERA_THERMAL_RANGE_DATA::ID => {
32847 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
32848 }
32849 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
32850 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
32851 .map(Self::CAMERA_TRACKING_GEO_STATUS)
32852 }
32853 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
32854 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
32855 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
32856 }
32857 CAMERA_TRIGGER_DATA::ID => {
32858 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
32859 }
32860 CANFD_FRAME_DATA::ID => {
32861 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
32862 }
32863 CAN_FILTER_MODIFY_DATA::ID => {
32864 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
32865 }
32866 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
32867 CELLULAR_CONFIG_DATA::ID => {
32868 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
32869 }
32870 CELLULAR_STATUS_DATA::ID => {
32871 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
32872 }
32873 CHANGE_OPERATOR_CONTROL_DATA::ID => {
32874 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
32875 .map(Self::CHANGE_OPERATOR_CONTROL)
32876 }
32877 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
32878 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
32879 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
32880 }
32881 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
32882 COMMAND_ACK_DATA::ID => {
32883 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
32884 }
32885 COMMAND_CANCEL_DATA::ID => {
32886 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
32887 }
32888 COMMAND_INT_DATA::ID => {
32889 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
32890 }
32891 COMMAND_LONG_DATA::ID => {
32892 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
32893 }
32894 COMPONENT_INFORMATION_DATA::ID => {
32895 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
32896 }
32897 COMPONENT_INFORMATION_BASIC_DATA::ID => {
32898 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
32899 .map(Self::COMPONENT_INFORMATION_BASIC)
32900 }
32901 COMPONENT_METADATA_DATA::ID => {
32902 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
32903 }
32904 CONTROL_STATUS_DATA::ID => {
32905 CONTROL_STATUS_DATA::deser(version, payload).map(Self::CONTROL_STATUS)
32906 }
32907 CONTROL_SYSTEM_STATE_DATA::ID => {
32908 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
32909 }
32910 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
32911 .map(Self::CURRENT_EVENT_SEQUENCE),
32912 CURRENT_MODE_DATA::ID => {
32913 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
32914 }
32915 DATA_STREAM_DATA::ID => {
32916 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
32917 }
32918 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
32919 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
32920 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
32921 }
32922 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
32923 DEBUG_FLOAT_ARRAY_DATA::ID => {
32924 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
32925 }
32926 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
32927 DISTANCE_SENSOR_DATA::ID => {
32928 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
32929 }
32930 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
32931 ENCAPSULATED_DATA_DATA::ID => {
32932 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
32933 }
32934 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
32935 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
32936 ESTIMATOR_STATUS_DATA::ID => {
32937 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
32938 }
32939 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
32940 EXTENDED_SYS_STATE_DATA::ID => {
32941 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
32942 }
32943 FENCE_STATUS_DATA::ID => {
32944 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
32945 }
32946 FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID => {
32947 FIGURE_EIGHT_EXECUTION_STATUS_DATA::deser(version, payload)
32948 .map(Self::FIGURE_EIGHT_EXECUTION_STATUS)
32949 }
32950 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
32951 .map(Self::FILE_TRANSFER_PROTOCOL),
32952 FLIGHT_INFORMATION_DATA::ID => {
32953 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
32954 }
32955 FOLLOW_TARGET_DATA::ID => {
32956 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
32957 }
32958 FUEL_STATUS_DATA::ID => {
32959 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
32960 }
32961 GENERATOR_STATUS_DATA::ID => {
32962 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
32963 }
32964 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
32965 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
32966 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
32967 }
32968 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
32969 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
32970 .map(Self::GIMBAL_DEVICE_INFORMATION)
32971 }
32972 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
32973 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
32974 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
32975 }
32976 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
32977 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
32978 .map(Self::GIMBAL_MANAGER_INFORMATION)
32979 }
32980 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
32981 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
32982 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
32983 }
32984 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
32985 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
32986 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
32987 }
32988 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
32989 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
32990 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
32991 }
32992 GIMBAL_MANAGER_STATUS_DATA::ID => {
32993 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
32994 }
32995 GLOBAL_POSITION_INT_DATA::ID => {
32996 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
32997 }
32998 GLOBAL_POSITION_INT_COV_DATA::ID => {
32999 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
33000 .map(Self::GLOBAL_POSITION_INT_COV)
33001 }
33002 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33003 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33004 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
33005 }
33006 GNSS_INTEGRITY_DATA::ID => {
33007 GNSS_INTEGRITY_DATA::deser(version, payload).map(Self::GNSS_INTEGRITY)
33008 }
33009 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
33010 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
33011 GPS_GLOBAL_ORIGIN_DATA::ID => {
33012 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
33013 }
33014 GPS_INJECT_DATA_DATA::ID => {
33015 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
33016 }
33017 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
33018 GPS_RAW_INT_DATA::ID => {
33019 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
33020 }
33021 GPS_RTCM_DATA_DATA::ID => {
33022 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
33023 }
33024 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
33025 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
33026 GROUP_END_DATA::ID => GROUP_END_DATA::deser(version, payload).map(Self::GROUP_END),
33027 GROUP_START_DATA::ID => {
33028 GROUP_START_DATA::deser(version, payload).map(Self::GROUP_START)
33029 }
33030 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
33031 HIGHRES_IMU_DATA::ID => {
33032 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
33033 }
33034 HIGH_LATENCY_DATA::ID => {
33035 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
33036 }
33037 HIGH_LATENCY2_DATA::ID => {
33038 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
33039 }
33040 HIL_ACTUATOR_CONTROLS_DATA::ID => {
33041 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
33042 }
33043 HIL_CONTROLS_DATA::ID => {
33044 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
33045 }
33046 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
33047 HIL_OPTICAL_FLOW_DATA::ID => {
33048 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
33049 }
33050 HIL_RC_INPUTS_RAW_DATA::ID => {
33051 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
33052 }
33053 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
33054 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
33055 HIL_STATE_QUATERNION_DATA::ID => {
33056 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
33057 }
33058 HOME_POSITION_DATA::ID => {
33059 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
33060 }
33061 HYGROMETER_SENSOR_DATA::ID => {
33062 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
33063 }
33064 ILLUMINATOR_STATUS_DATA::ID => {
33065 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
33066 }
33067 ISBD_LINK_STATUS_DATA::ID => {
33068 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
33069 }
33070 LANDING_TARGET_DATA::ID => {
33071 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
33072 }
33073 LINK_NODE_STATUS_DATA::ID => {
33074 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
33075 }
33076 LOCAL_POSITION_NED_DATA::ID => {
33077 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
33078 }
33079 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
33080 .map(Self::LOCAL_POSITION_NED_COV),
33081 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33082 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
33083 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
33084 }
33085 LOGGING_ACK_DATA::ID => {
33086 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
33087 }
33088 LOGGING_DATA_DATA::ID => {
33089 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
33090 }
33091 LOGGING_DATA_ACKED_DATA::ID => {
33092 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
33093 }
33094 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
33095 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
33096 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
33097 LOG_REQUEST_DATA_DATA::ID => {
33098 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
33099 }
33100 LOG_REQUEST_END_DATA::ID => {
33101 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
33102 }
33103 LOG_REQUEST_LIST_DATA::ID => {
33104 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
33105 }
33106 MAG_CAL_REPORT_DATA::ID => {
33107 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
33108 }
33109 MANUAL_CONTROL_DATA::ID => {
33110 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
33111 }
33112 MANUAL_SETPOINT_DATA::ID => {
33113 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
33114 }
33115 MEMORY_VECT_DATA::ID => {
33116 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
33117 }
33118 MESSAGE_INTERVAL_DATA::ID => {
33119 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
33120 }
33121 MISSION_ACK_DATA::ID => {
33122 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
33123 }
33124 MISSION_CLEAR_ALL_DATA::ID => {
33125 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
33126 }
33127 MISSION_COUNT_DATA::ID => {
33128 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
33129 }
33130 MISSION_CURRENT_DATA::ID => {
33131 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
33132 }
33133 MISSION_ITEM_DATA::ID => {
33134 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
33135 }
33136 MISSION_ITEM_INT_DATA::ID => {
33137 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
33138 }
33139 MISSION_ITEM_REACHED_DATA::ID => {
33140 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
33141 }
33142 MISSION_REQUEST_DATA::ID => {
33143 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
33144 }
33145 MISSION_REQUEST_INT_DATA::ID => {
33146 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
33147 }
33148 MISSION_REQUEST_LIST_DATA::ID => {
33149 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
33150 }
33151 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
33152 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
33153 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
33154 }
33155 MISSION_SET_CURRENT_DATA::ID => {
33156 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
33157 }
33158 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
33159 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
33160 .map(Self::MISSION_WRITE_PARTIAL_LIST)
33161 }
33162 MOUNT_ORIENTATION_DATA::ID => {
33163 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
33164 }
33165 NAMED_VALUE_FLOAT_DATA::ID => {
33166 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
33167 }
33168 NAMED_VALUE_INT_DATA::ID => {
33169 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
33170 }
33171 NAV_CONTROLLER_OUTPUT_DATA::ID => {
33172 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
33173 }
33174 OBSTACLE_DISTANCE_DATA::ID => {
33175 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
33176 }
33177 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
33178 ONBOARD_COMPUTER_STATUS_DATA::ID => {
33179 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
33180 .map(Self::ONBOARD_COMPUTER_STATUS)
33181 }
33182 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
33183 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
33184 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
33185 }
33186 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
33187 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
33188 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
33189 }
33190 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
33191 .map(Self::OPEN_DRONE_ID_BASIC_ID),
33192 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
33193 .map(Self::OPEN_DRONE_ID_LOCATION),
33194 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
33195 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
33196 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
33197 }
33198 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
33199 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
33200 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
33201 }
33202 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33203 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33204 }
33205 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33206 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33207 }
33208 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33209 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33210 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33211 }
33212 OPTICAL_FLOW_DATA::ID => {
33213 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33214 }
33215 OPTICAL_FLOW_RAD_DATA::ID => {
33216 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33217 }
33218 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33219 .map(Self::ORBIT_EXECUTION_STATUS),
33220 PARAM_EXT_ACK_DATA::ID => {
33221 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33222 }
33223 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33224 .map(Self::PARAM_EXT_REQUEST_LIST),
33225 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33226 .map(Self::PARAM_EXT_REQUEST_READ),
33227 PARAM_EXT_SET_DATA::ID => {
33228 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33229 }
33230 PARAM_EXT_VALUE_DATA::ID => {
33231 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33232 }
33233 PARAM_MAP_RC_DATA::ID => {
33234 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33235 }
33236 PARAM_REQUEST_LIST_DATA::ID => {
33237 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33238 }
33239 PARAM_REQUEST_READ_DATA::ID => {
33240 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33241 }
33242 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
33243 PARAM_VALUE_DATA::ID => {
33244 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
33245 }
33246 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
33247 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
33248 PLAY_TUNE_V2_DATA::ID => {
33249 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
33250 }
33251 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33252 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33253 .map(Self::POSITION_TARGET_GLOBAL_INT)
33254 }
33255 POSITION_TARGET_LOCAL_NED_DATA::ID => {
33256 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33257 .map(Self::POSITION_TARGET_LOCAL_NED)
33258 }
33259 POWER_STATUS_DATA::ID => {
33260 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
33261 }
33262 PROTOCOL_VERSION_DATA::ID => {
33263 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
33264 }
33265 RADIO_RC_CHANNELS_DATA::ID => {
33266 RADIO_RC_CHANNELS_DATA::deser(version, payload).map(Self::RADIO_RC_CHANNELS)
33267 }
33268 RADIO_STATUS_DATA::ID => {
33269 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
33270 }
33271 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
33272 RAW_PRESSURE_DATA::ID => {
33273 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
33274 }
33275 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
33276 RC_CHANNELS_DATA::ID => {
33277 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
33278 }
33279 RC_CHANNELS_OVERRIDE_DATA::ID => {
33280 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
33281 }
33282 RC_CHANNELS_RAW_DATA::ID => {
33283 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
33284 }
33285 RC_CHANNELS_SCALED_DATA::ID => {
33286 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
33287 }
33288 REQUEST_DATA_STREAM_DATA::ID => {
33289 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
33290 }
33291 REQUEST_EVENT_DATA::ID => {
33292 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
33293 }
33294 RESOURCE_REQUEST_DATA::ID => {
33295 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
33296 }
33297 RESPONSE_EVENT_ERROR_DATA::ID => {
33298 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
33299 }
33300 SAFETY_ALLOWED_AREA_DATA::ID => {
33301 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
33302 }
33303 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
33304 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
33305 .map(Self::SAFETY_SET_ALLOWED_AREA)
33306 }
33307 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
33308 SCALED_IMU2_DATA::ID => {
33309 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
33310 }
33311 SCALED_IMU3_DATA::ID => {
33312 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
33313 }
33314 SCALED_PRESSURE_DATA::ID => {
33315 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
33316 }
33317 SCALED_PRESSURE2_DATA::ID => {
33318 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
33319 }
33320 SCALED_PRESSURE3_DATA::ID => {
33321 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
33322 }
33323 SERIAL_CONTROL_DATA::ID => {
33324 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
33325 }
33326 SERVO_OUTPUT_RAW_DATA::ID => {
33327 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
33328 }
33329 SETUP_SIGNING_DATA::ID => {
33330 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
33331 }
33332 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
33333 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33334 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
33335 }
33336 SET_ATTITUDE_TARGET_DATA::ID => {
33337 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
33338 }
33339 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
33340 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
33341 }
33342 SET_HOME_POSITION_DATA::ID => {
33343 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
33344 }
33345 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
33346 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33347 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33348 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
33349 }
33350 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
33351 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33352 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
33353 }
33354 SET_VELOCITY_LIMITS_DATA::ID => {
33355 SET_VELOCITY_LIMITS_DATA::deser(version, payload).map(Self::SET_VELOCITY_LIMITS)
33356 }
33357 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
33358 SMART_BATTERY_INFO_DATA::ID => {
33359 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
33360 }
33361 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
33362 STORAGE_INFORMATION_DATA::ID => {
33363 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
33364 }
33365 SUPPORTED_TUNES_DATA::ID => {
33366 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
33367 }
33368 SYSTEM_TIME_DATA::ID => {
33369 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
33370 }
33371 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
33372 TARGET_ABSOLUTE_DATA::ID => {
33373 TARGET_ABSOLUTE_DATA::deser(version, payload).map(Self::TARGET_ABSOLUTE)
33374 }
33375 TARGET_RELATIVE_DATA::ID => {
33376 TARGET_RELATIVE_DATA::deser(version, payload).map(Self::TARGET_RELATIVE)
33377 }
33378 TERRAIN_CHECK_DATA::ID => {
33379 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
33380 }
33381 TERRAIN_DATA_DATA::ID => {
33382 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
33383 }
33384 TERRAIN_REPORT_DATA::ID => {
33385 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
33386 }
33387 TERRAIN_REQUEST_DATA::ID => {
33388 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
33389 }
33390 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
33391 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
33392 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
33393 .map(Self::TIME_ESTIMATE_TO_TARGET)
33394 }
33395 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33396 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
33397 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
33398 }
33399 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33400 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
33401 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
33402 }
33403 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
33404 UAVCAN_NODE_INFO_DATA::ID => {
33405 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
33406 }
33407 UAVCAN_NODE_STATUS_DATA::ID => {
33408 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
33409 }
33410 UTM_GLOBAL_POSITION_DATA::ID => {
33411 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
33412 }
33413 V2_EXTENSION_DATA::ID => {
33414 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
33415 }
33416 VELOCITY_LIMITS_DATA::ID => {
33417 VELOCITY_LIMITS_DATA::deser(version, payload).map(Self::VELOCITY_LIMITS)
33418 }
33419 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
33420 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
33421 VICON_POSITION_ESTIMATE_DATA::ID => {
33422 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
33423 .map(Self::VICON_POSITION_ESTIMATE)
33424 }
33425 VIDEO_STREAM_INFORMATION_DATA::ID => {
33426 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
33427 .map(Self::VIDEO_STREAM_INFORMATION)
33428 }
33429 VIDEO_STREAM_STATUS_DATA::ID => {
33430 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
33431 }
33432 VISION_POSITION_ESTIMATE_DATA::ID => {
33433 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33434 .map(Self::VISION_POSITION_ESTIMATE)
33435 }
33436 VISION_SPEED_ESTIMATE_DATA::ID => {
33437 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
33438 }
33439 WHEEL_DISTANCE_DATA::ID => {
33440 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
33441 }
33442 WIFI_CONFIG_AP_DATA::ID => {
33443 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
33444 }
33445 WINCH_STATUS_DATA::ID => {
33446 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
33447 }
33448 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
33449 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
33450 }
33451 }
33452 fn message_name(&self) -> &'static str {
33453 match self {
33454 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
33455 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
33456 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
33457 Self::AIRSPEED(..) => AIRSPEED_DATA::NAME,
33458 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
33459 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
33460 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
33461 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
33462 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
33463 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
33464 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
33465 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
33466 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33467 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
33468 }
33469 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
33470 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
33471 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
33472 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
33473 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
33474 Self::BATTERY_STATUS_V2(..) => BATTERY_STATUS_V2_DATA::NAME,
33475 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
33476 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
33477 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
33478 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
33479 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
33480 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
33481 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
33482 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
33483 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
33484 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
33485 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
33486 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
33487 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
33488 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
33489 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
33490 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
33491 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
33492 Self::COLLISION(..) => COLLISION_DATA::NAME,
33493 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
33494 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
33495 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
33496 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
33497 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
33498 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
33499 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
33500 Self::CONTROL_STATUS(..) => CONTROL_STATUS_DATA::NAME,
33501 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
33502 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
33503 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
33504 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
33505 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
33506 Self::DEBUG(..) => DEBUG_DATA::NAME,
33507 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
33508 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
33509 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
33510 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
33511 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
33512 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
33513 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
33514 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
33515 Self::EVENT(..) => EVENT_DATA::NAME,
33516 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
33517 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
33518 Self::FIGURE_EIGHT_EXECUTION_STATUS(..) => FIGURE_EIGHT_EXECUTION_STATUS_DATA::NAME,
33519 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
33520 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
33521 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
33522 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
33523 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
33524 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
33525 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
33526 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
33527 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
33528 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
33529 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33530 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
33531 }
33532 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
33533 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
33534 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
33535 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
33536 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
33537 Self::GNSS_INTEGRITY(..) => GNSS_INTEGRITY_DATA::NAME,
33538 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
33539 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
33540 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
33541 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
33542 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
33543 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
33544 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
33545 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
33546 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
33547 Self::GROUP_END(..) => GROUP_END_DATA::NAME,
33548 Self::GROUP_START(..) => GROUP_START_DATA::NAME,
33549 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
33550 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
33551 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
33552 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
33553 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
33554 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
33555 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
33556 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
33557 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
33558 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
33559 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
33560 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
33561 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
33562 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
33563 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
33564 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
33565 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
33566 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
33567 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
33568 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
33569 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33570 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
33571 }
33572 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
33573 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
33574 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
33575 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
33576 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
33577 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
33578 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
33579 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
33580 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
33581 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
33582 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
33583 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
33584 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
33585 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
33586 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
33587 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
33588 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
33589 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
33590 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
33591 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
33592 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
33593 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
33594 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
33595 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
33596 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
33597 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
33598 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
33599 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
33600 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
33601 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
33602 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
33603 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
33604 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
33605 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
33606 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
33607 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
33608 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
33609 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
33610 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
33611 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
33612 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
33613 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
33614 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
33615 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
33616 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
33617 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
33618 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
33619 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
33620 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
33621 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
33622 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
33623 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
33624 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
33625 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
33626 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
33627 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
33628 Self::PING(..) => PING_DATA::NAME,
33629 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
33630 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
33631 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33632 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
33633 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
33634 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
33635 Self::RADIO_RC_CHANNELS(..) => RADIO_RC_CHANNELS_DATA::NAME,
33636 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
33637 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
33638 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
33639 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
33640 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
33641 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
33642 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
33643 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
33644 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
33645 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
33646 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
33647 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
33648 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
33649 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
33650 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
33651 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
33652 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
33653 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
33654 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
33655 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
33656 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
33657 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
33658 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
33659 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
33660 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
33661 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
33662 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
33663 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
33664 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33665 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
33666 Self::SET_VELOCITY_LIMITS(..) => SET_VELOCITY_LIMITS_DATA::NAME,
33667 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
33668 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
33669 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
33670 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
33671 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
33672 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
33673 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
33674 Self::TARGET_ABSOLUTE(..) => TARGET_ABSOLUTE_DATA::NAME,
33675 Self::TARGET_RELATIVE(..) => TARGET_RELATIVE_DATA::NAME,
33676 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
33677 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
33678 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
33679 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
33680 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
33681 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
33682 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
33683 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
33684 }
33685 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33686 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
33687 }
33688 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
33689 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
33690 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
33691 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
33692 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
33693 Self::VELOCITY_LIMITS(..) => VELOCITY_LIMITS_DATA::NAME,
33694 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
33695 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
33696 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
33697 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
33698 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
33699 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
33700 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
33701 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
33702 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
33703 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
33704 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
33705 }
33706 }
33707 fn message_id(&self) -> u32 {
33708 match self {
33709 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
33710 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
33711 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
33712 Self::AIRSPEED(..) => AIRSPEED_DATA::ID,
33713 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
33714 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
33715 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
33716 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
33717 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
33718 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
33719 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
33720 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
33721 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33722 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
33723 }
33724 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
33725 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
33726 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
33727 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
33728 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
33729 Self::BATTERY_STATUS_V2(..) => BATTERY_STATUS_V2_DATA::ID,
33730 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
33731 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
33732 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
33733 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
33734 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
33735 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
33736 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
33737 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
33738 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
33739 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
33740 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
33741 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
33742 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
33743 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
33744 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
33745 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
33746 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
33747 Self::COLLISION(..) => COLLISION_DATA::ID,
33748 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
33749 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
33750 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
33751 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
33752 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
33753 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
33754 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
33755 Self::CONTROL_STATUS(..) => CONTROL_STATUS_DATA::ID,
33756 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
33757 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
33758 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
33759 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
33760 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
33761 Self::DEBUG(..) => DEBUG_DATA::ID,
33762 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
33763 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
33764 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
33765 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
33766 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
33767 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
33768 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
33769 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
33770 Self::EVENT(..) => EVENT_DATA::ID,
33771 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
33772 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
33773 Self::FIGURE_EIGHT_EXECUTION_STATUS(..) => FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID,
33774 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
33775 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
33776 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
33777 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
33778 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
33779 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
33780 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
33781 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
33782 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
33783 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
33784 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33785 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
33786 }
33787 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
33788 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
33789 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
33790 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
33791 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
33792 Self::GNSS_INTEGRITY(..) => GNSS_INTEGRITY_DATA::ID,
33793 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
33794 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
33795 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
33796 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
33797 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
33798 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
33799 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
33800 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
33801 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
33802 Self::GROUP_END(..) => GROUP_END_DATA::ID,
33803 Self::GROUP_START(..) => GROUP_START_DATA::ID,
33804 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
33805 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
33806 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
33807 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
33808 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
33809 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
33810 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
33811 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
33812 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
33813 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
33814 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
33815 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
33816 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
33817 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
33818 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
33819 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
33820 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
33821 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
33822 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
33823 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
33824 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33825 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
33826 }
33827 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
33828 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
33829 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
33830 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
33831 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
33832 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
33833 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
33834 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
33835 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
33836 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
33837 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
33838 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
33839 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
33840 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
33841 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
33842 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
33843 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
33844 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
33845 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
33846 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
33847 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
33848 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
33849 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
33850 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
33851 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
33852 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
33853 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
33854 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
33855 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
33856 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
33857 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
33858 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
33859 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
33860 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
33861 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
33862 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
33863 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
33864 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
33865 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
33866 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
33867 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
33868 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
33869 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
33870 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
33871 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
33872 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
33873 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
33874 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
33875 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
33876 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
33877 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
33878 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
33879 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
33880 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
33881 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
33882 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
33883 Self::PING(..) => PING_DATA::ID,
33884 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
33885 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
33886 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
33887 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
33888 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
33889 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
33890 Self::RADIO_RC_CHANNELS(..) => RADIO_RC_CHANNELS_DATA::ID,
33891 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
33892 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
33893 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
33894 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
33895 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
33896 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
33897 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
33898 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
33899 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
33900 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
33901 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
33902 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
33903 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
33904 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
33905 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
33906 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
33907 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
33908 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
33909 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
33910 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
33911 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
33912 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
33913 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
33914 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
33915 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
33916 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
33917 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
33918 Self::SET_MODE(..) => SET_MODE_DATA::ID,
33919 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
33920 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
33921 Self::SET_VELOCITY_LIMITS(..) => SET_VELOCITY_LIMITS_DATA::ID,
33922 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
33923 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
33924 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
33925 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
33926 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
33927 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
33928 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
33929 Self::TARGET_ABSOLUTE(..) => TARGET_ABSOLUTE_DATA::ID,
33930 Self::TARGET_RELATIVE(..) => TARGET_RELATIVE_DATA::ID,
33931 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
33932 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
33933 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
33934 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
33935 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
33936 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
33937 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
33938 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33939 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
33940 }
33941 Self::TUNNEL(..) => TUNNEL_DATA::ID,
33942 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
33943 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
33944 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
33945 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
33946 Self::VELOCITY_LIMITS(..) => VELOCITY_LIMITS_DATA::ID,
33947 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
33948 Self::VIBRATION(..) => VIBRATION_DATA::ID,
33949 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
33950 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
33951 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
33952 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
33953 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
33954 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
33955 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
33956 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
33957 Self::WIND_COV(..) => WIND_COV_DATA::ID,
33958 }
33959 }
33960 fn message_id_from_name(name: &str) -> Option<u32> {
33961 match name {
33962 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
33963 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
33964 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
33965 AIRSPEED_DATA::NAME => Some(AIRSPEED_DATA::ID),
33966 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
33967 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
33968 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
33969 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
33970 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
33971 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
33972 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
33973 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
33974 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
33975 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
33976 }
33977 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
33978 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
33979 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
33980 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
33981 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
33982 BATTERY_STATUS_V2_DATA::NAME => Some(BATTERY_STATUS_V2_DATA::ID),
33983 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
33984 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
33985 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
33986 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
33987 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
33988 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
33989 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
33990 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
33991 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
33992 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
33993 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
33994 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
33995 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
33996 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
33997 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
33998 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
33999 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
34000 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
34001 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
34002 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
34003 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
34004 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
34005 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
34006 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
34007 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
34008 CONTROL_STATUS_DATA::NAME => Some(CONTROL_STATUS_DATA::ID),
34009 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
34010 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
34011 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
34012 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
34013 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
34014 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
34015 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
34016 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
34017 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
34018 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
34019 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
34020 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
34021 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
34022 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
34023 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
34024 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
34025 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
34026 FIGURE_EIGHT_EXECUTION_STATUS_DATA::NAME => {
34027 Some(FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID)
34028 }
34029 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
34030 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
34031 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
34032 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
34033 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
34034 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
34035 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
34036 }
34037 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
34038 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
34039 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
34040 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
34041 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
34042 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
34043 }
34044 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
34045 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
34046 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
34047 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
34048 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
34049 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
34050 }
34051 GNSS_INTEGRITY_DATA::NAME => Some(GNSS_INTEGRITY_DATA::ID),
34052 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
34053 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
34054 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
34055 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
34056 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
34057 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
34058 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
34059 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
34060 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
34061 GROUP_END_DATA::NAME => Some(GROUP_END_DATA::ID),
34062 GROUP_START_DATA::NAME => Some(GROUP_START_DATA::ID),
34063 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
34064 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
34065 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
34066 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
34067 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
34068 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
34069 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
34070 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
34071 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
34072 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
34073 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
34074 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
34075 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
34076 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
34077 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
34078 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
34079 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
34080 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
34081 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
34082 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
34083 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
34084 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
34085 }
34086 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
34087 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
34088 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
34089 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
34090 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
34091 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
34092 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
34093 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
34094 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
34095 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
34096 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
34097 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
34098 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
34099 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
34100 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
34101 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
34102 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
34103 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
34104 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
34105 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
34106 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
34107 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
34108 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
34109 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
34110 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
34111 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
34112 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
34113 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
34114 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
34115 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
34116 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
34117 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
34118 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
34119 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
34120 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
34121 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
34122 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
34123 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
34124 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
34125 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
34126 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
34127 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
34128 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
34129 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
34130 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
34131 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
34132 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
34133 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
34134 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
34135 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
34136 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
34137 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
34138 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
34139 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
34140 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
34141 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
34142 PING_DATA::NAME => Some(PING_DATA::ID),
34143 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
34144 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
34145 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
34146 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
34147 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
34148 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
34149 RADIO_RC_CHANNELS_DATA::NAME => Some(RADIO_RC_CHANNELS_DATA::ID),
34150 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
34151 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
34152 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
34153 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
34154 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
34155 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
34156 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
34157 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
34158 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
34159 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
34160 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
34161 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
34162 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
34163 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
34164 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
34165 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
34166 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
34167 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
34168 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
34169 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
34170 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
34171 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
34172 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
34173 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
34174 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
34175 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
34176 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
34177 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
34178 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
34179 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
34180 }
34181 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
34182 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
34183 }
34184 SET_VELOCITY_LIMITS_DATA::NAME => Some(SET_VELOCITY_LIMITS_DATA::ID),
34185 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
34186 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
34187 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
34188 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
34189 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
34190 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
34191 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
34192 TARGET_ABSOLUTE_DATA::NAME => Some(TARGET_ABSOLUTE_DATA::ID),
34193 TARGET_RELATIVE_DATA::NAME => Some(TARGET_RELATIVE_DATA::ID),
34194 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
34195 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
34196 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
34197 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
34198 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
34199 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
34200 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
34201 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
34202 }
34203 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
34204 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
34205 }
34206 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
34207 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
34208 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
34209 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
34210 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
34211 VELOCITY_LIMITS_DATA::NAME => Some(VELOCITY_LIMITS_DATA::ID),
34212 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
34213 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
34214 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
34215 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
34216 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
34217 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
34218 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
34219 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
34220 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
34221 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
34222 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
34223 _ => None,
34224 }
34225 }
34226 fn default_message_from_id(id: u32) -> Option<Self> {
34227 match id {
34228 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34229 ACTUATOR_CONTROL_TARGET_DATA::default(),
34230 )),
34231 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34232 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34233 )),
34234 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
34235 AIRSPEED_DATA::ID => Some(Self::AIRSPEED(AIRSPEED_DATA::default())),
34236 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
34237 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34238 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
34239 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34240 ATTITUDE_QUATERNION_DATA::default(),
34241 )),
34242 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34243 ATTITUDE_QUATERNION_COV_DATA::default(),
34244 )),
34245 ATTITUDE_TARGET_DATA::ID => {
34246 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
34247 }
34248 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
34249 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34250 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34251 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34252 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
34253 ))
34254 }
34255 AUTOPILOT_VERSION_DATA::ID => {
34256 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34257 }
34258 AVAILABLE_MODES_DATA::ID => {
34259 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
34260 }
34261 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34262 AVAILABLE_MODES_MONITOR_DATA::default(),
34263 )),
34264 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34265 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
34266 BATTERY_STATUS_V2_DATA::ID => {
34267 Some(Self::BATTERY_STATUS_V2(BATTERY_STATUS_V2_DATA::default()))
34268 }
34269 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
34270 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34271 CAMERA_CAPTURE_STATUS_DATA::default(),
34272 )),
34273 CAMERA_FOV_STATUS_DATA::ID => {
34274 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
34275 }
34276 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34277 CAMERA_IMAGE_CAPTURED_DATA::default(),
34278 )),
34279 CAMERA_INFORMATION_DATA::ID => {
34280 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
34281 }
34282 CAMERA_SETTINGS_DATA::ID => {
34283 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
34284 }
34285 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34286 CAMERA_THERMAL_RANGE_DATA::default(),
34287 )),
34288 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34289 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
34290 )),
34291 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34292 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
34293 )),
34294 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
34295 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
34296 CAN_FILTER_MODIFY_DATA::ID => {
34297 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
34298 }
34299 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
34300 CELLULAR_CONFIG_DATA::ID => {
34301 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
34302 }
34303 CELLULAR_STATUS_DATA::ID => {
34304 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
34305 }
34306 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34307 CHANGE_OPERATOR_CONTROL_DATA::default(),
34308 )),
34309 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34310 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
34311 )),
34312 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
34313 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
34314 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
34315 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
34316 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
34317 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34318 COMPONENT_INFORMATION_DATA::default(),
34319 )),
34320 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34321 COMPONENT_INFORMATION_BASIC_DATA::default(),
34322 )),
34323 COMPONENT_METADATA_DATA::ID => {
34324 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
34325 }
34326 CONTROL_STATUS_DATA::ID => Some(Self::CONTROL_STATUS(CONTROL_STATUS_DATA::default())),
34327 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34328 CONTROL_SYSTEM_STATE_DATA::default(),
34329 )),
34330 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34331 CURRENT_EVENT_SEQUENCE_DATA::default(),
34332 )),
34333 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
34334 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
34335 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34336 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
34337 )),
34338 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
34339 DEBUG_FLOAT_ARRAY_DATA::ID => {
34340 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
34341 }
34342 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
34343 DISTANCE_SENSOR_DATA::ID => {
34344 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
34345 }
34346 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
34347 ENCAPSULATED_DATA_DATA::ID => {
34348 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
34349 }
34350 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
34351 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
34352 ESTIMATOR_STATUS_DATA::ID => {
34353 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
34354 }
34355 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
34356 EXTENDED_SYS_STATE_DATA::ID => {
34357 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
34358 }
34359 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
34360 FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID => Some(Self::FIGURE_EIGHT_EXECUTION_STATUS(
34361 FIGURE_EIGHT_EXECUTION_STATUS_DATA::default(),
34362 )),
34363 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34364 FILE_TRANSFER_PROTOCOL_DATA::default(),
34365 )),
34366 FLIGHT_INFORMATION_DATA::ID => {
34367 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
34368 }
34369 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
34370 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
34371 GENERATOR_STATUS_DATA::ID => {
34372 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
34373 }
34374 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34375 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
34376 )),
34377 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34378 GIMBAL_DEVICE_INFORMATION_DATA::default(),
34379 )),
34380 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34381 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
34382 )),
34383 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34384 GIMBAL_MANAGER_INFORMATION_DATA::default(),
34385 )),
34386 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
34387 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
34388 )),
34389 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34390 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
34391 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
34392 ))
34393 }
34394 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34395 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
34396 )),
34397 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34398 GIMBAL_MANAGER_STATUS_DATA::default(),
34399 )),
34400 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34401 GLOBAL_POSITION_INT_DATA::default(),
34402 )),
34403 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
34404 GLOBAL_POSITION_INT_COV_DATA::default(),
34405 )),
34406 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34407 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34408 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
34409 ))
34410 }
34411 GNSS_INTEGRITY_DATA::ID => Some(Self::GNSS_INTEGRITY(GNSS_INTEGRITY_DATA::default())),
34412 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
34413 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
34414 GPS_GLOBAL_ORIGIN_DATA::ID => {
34415 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
34416 }
34417 GPS_INJECT_DATA_DATA::ID => {
34418 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
34419 }
34420 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
34421 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
34422 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
34423 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
34424 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
34425 GROUP_END_DATA::ID => Some(Self::GROUP_END(GROUP_END_DATA::default())),
34426 GROUP_START_DATA::ID => Some(Self::GROUP_START(GROUP_START_DATA::default())),
34427 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
34428 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
34429 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
34430 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
34431 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
34432 HIL_ACTUATOR_CONTROLS_DATA::default(),
34433 )),
34434 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
34435 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
34436 HIL_OPTICAL_FLOW_DATA::ID => {
34437 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
34438 }
34439 HIL_RC_INPUTS_RAW_DATA::ID => {
34440 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
34441 }
34442 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
34443 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
34444 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
34445 HIL_STATE_QUATERNION_DATA::default(),
34446 )),
34447 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
34448 HYGROMETER_SENSOR_DATA::ID => {
34449 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
34450 }
34451 ILLUMINATOR_STATUS_DATA::ID => {
34452 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
34453 }
34454 ISBD_LINK_STATUS_DATA::ID => {
34455 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
34456 }
34457 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
34458 LINK_NODE_STATUS_DATA::ID => {
34459 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
34460 }
34461 LOCAL_POSITION_NED_DATA::ID => {
34462 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
34463 }
34464 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
34465 LOCAL_POSITION_NED_COV_DATA::default(),
34466 )),
34467 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34468 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
34469 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
34470 ))
34471 }
34472 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
34473 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
34474 LOGGING_DATA_ACKED_DATA::ID => {
34475 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
34476 }
34477 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
34478 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
34479 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
34480 LOG_REQUEST_DATA_DATA::ID => {
34481 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
34482 }
34483 LOG_REQUEST_END_DATA::ID => {
34484 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
34485 }
34486 LOG_REQUEST_LIST_DATA::ID => {
34487 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
34488 }
34489 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
34490 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
34491 MANUAL_SETPOINT_DATA::ID => {
34492 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
34493 }
34494 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
34495 MESSAGE_INTERVAL_DATA::ID => {
34496 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
34497 }
34498 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
34499 MISSION_CLEAR_ALL_DATA::ID => {
34500 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
34501 }
34502 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
34503 MISSION_CURRENT_DATA::ID => {
34504 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
34505 }
34506 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
34507 MISSION_ITEM_INT_DATA::ID => {
34508 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
34509 }
34510 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34511 MISSION_ITEM_REACHED_DATA::default(),
34512 )),
34513 MISSION_REQUEST_DATA::ID => {
34514 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
34515 }
34516 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
34517 MISSION_REQUEST_INT_DATA::default(),
34518 )),
34519 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34520 MISSION_REQUEST_LIST_DATA::default(),
34521 )),
34522 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34523 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
34524 )),
34525 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34526 MISSION_SET_CURRENT_DATA::default(),
34527 )),
34528 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34529 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
34530 )),
34531 MOUNT_ORIENTATION_DATA::ID => {
34532 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
34533 }
34534 NAMED_VALUE_FLOAT_DATA::ID => {
34535 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
34536 }
34537 NAMED_VALUE_INT_DATA::ID => {
34538 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
34539 }
34540 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34541 NAV_CONTROLLER_OUTPUT_DATA::default(),
34542 )),
34543 OBSTACLE_DISTANCE_DATA::ID => {
34544 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
34545 }
34546 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
34547 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34548 ONBOARD_COMPUTER_STATUS_DATA::default(),
34549 )),
34550 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34551 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
34552 )),
34553 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34554 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
34555 )),
34556 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34557 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
34558 )),
34559 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34560 OPEN_DRONE_ID_LOCATION_DATA::default(),
34561 )),
34562 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34563 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
34564 )),
34565 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34566 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
34567 )),
34568 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34569 OPEN_DRONE_ID_SELF_ID_DATA::default(),
34570 )),
34571 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34572 OPEN_DRONE_ID_SYSTEM_DATA::default(),
34573 )),
34574 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34575 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
34576 )),
34577 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
34578 OPTICAL_FLOW_RAD_DATA::ID => {
34579 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
34580 }
34581 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34582 ORBIT_EXECUTION_STATUS_DATA::default(),
34583 )),
34584 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
34585 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34586 PARAM_EXT_REQUEST_LIST_DATA::default(),
34587 )),
34588 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34589 PARAM_EXT_REQUEST_READ_DATA::default(),
34590 )),
34591 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
34592 PARAM_EXT_VALUE_DATA::ID => {
34593 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
34594 }
34595 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
34596 PARAM_REQUEST_LIST_DATA::ID => {
34597 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
34598 }
34599 PARAM_REQUEST_READ_DATA::ID => {
34600 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
34601 }
34602 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
34603 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
34604 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
34605 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
34606 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
34607 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34608 POSITION_TARGET_GLOBAL_INT_DATA::default(),
34609 )),
34610 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34611 POSITION_TARGET_LOCAL_NED_DATA::default(),
34612 )),
34613 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
34614 PROTOCOL_VERSION_DATA::ID => {
34615 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
34616 }
34617 RADIO_RC_CHANNELS_DATA::ID => {
34618 Some(Self::RADIO_RC_CHANNELS(RADIO_RC_CHANNELS_DATA::default()))
34619 }
34620 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
34621 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
34622 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
34623 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
34624 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
34625 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
34626 RC_CHANNELS_OVERRIDE_DATA::default(),
34627 )),
34628 RC_CHANNELS_RAW_DATA::ID => {
34629 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
34630 }
34631 RC_CHANNELS_SCALED_DATA::ID => {
34632 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
34633 }
34634 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
34635 REQUEST_DATA_STREAM_DATA::default(),
34636 )),
34637 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
34638 RESOURCE_REQUEST_DATA::ID => {
34639 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
34640 }
34641 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
34642 RESPONSE_EVENT_ERROR_DATA::default(),
34643 )),
34644 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
34645 SAFETY_ALLOWED_AREA_DATA::default(),
34646 )),
34647 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
34648 SAFETY_SET_ALLOWED_AREA_DATA::default(),
34649 )),
34650 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
34651 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
34652 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
34653 SCALED_PRESSURE_DATA::ID => {
34654 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
34655 }
34656 SCALED_PRESSURE2_DATA::ID => {
34657 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
34658 }
34659 SCALED_PRESSURE3_DATA::ID => {
34660 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
34661 }
34662 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
34663 SERVO_OUTPUT_RAW_DATA::ID => {
34664 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
34665 }
34666 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
34667 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34668 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
34669 )),
34670 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34671 SET_ATTITUDE_TARGET_DATA::default(),
34672 )),
34673 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34674 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
34675 )),
34676 SET_HOME_POSITION_DATA::ID => {
34677 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
34678 }
34679 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
34680 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34681 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
34682 )),
34683 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34684 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
34685 )),
34686 SET_VELOCITY_LIMITS_DATA::ID => Some(Self::SET_VELOCITY_LIMITS(
34687 SET_VELOCITY_LIMITS_DATA::default(),
34688 )),
34689 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
34690 SMART_BATTERY_INFO_DATA::ID => {
34691 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
34692 }
34693 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
34694 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34695 STORAGE_INFORMATION_DATA::default(),
34696 )),
34697 SUPPORTED_TUNES_DATA::ID => {
34698 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
34699 }
34700 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
34701 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
34702 TARGET_ABSOLUTE_DATA::ID => {
34703 Some(Self::TARGET_ABSOLUTE(TARGET_ABSOLUTE_DATA::default()))
34704 }
34705 TARGET_RELATIVE_DATA::ID => {
34706 Some(Self::TARGET_RELATIVE(TARGET_RELATIVE_DATA::default()))
34707 }
34708 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
34709 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
34710 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
34711 TERRAIN_REQUEST_DATA::ID => {
34712 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
34713 }
34714 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
34715 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34716 TIME_ESTIMATE_TO_TARGET_DATA::default(),
34717 )),
34718 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34719 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34720 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
34721 ))
34722 }
34723 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34724 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34725 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
34726 ))
34727 }
34728 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
34729 UAVCAN_NODE_INFO_DATA::ID => {
34730 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
34731 }
34732 UAVCAN_NODE_STATUS_DATA::ID => {
34733 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
34734 }
34735 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34736 UTM_GLOBAL_POSITION_DATA::default(),
34737 )),
34738 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
34739 VELOCITY_LIMITS_DATA::ID => {
34740 Some(Self::VELOCITY_LIMITS(VELOCITY_LIMITS_DATA::default()))
34741 }
34742 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
34743 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
34744 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34745 VICON_POSITION_ESTIMATE_DATA::default(),
34746 )),
34747 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34748 VIDEO_STREAM_INFORMATION_DATA::default(),
34749 )),
34750 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34751 VIDEO_STREAM_STATUS_DATA::default(),
34752 )),
34753 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34754 VISION_POSITION_ESTIMATE_DATA::default(),
34755 )),
34756 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34757 VISION_SPEED_ESTIMATE_DATA::default(),
34758 )),
34759 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
34760 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
34761 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
34762 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
34763 _ => None,
34764 }
34765 }
34766 #[cfg(feature = "arbitrary")]
34767 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
34768 match id {
34769 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34770 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34771 )),
34772 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34773 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
34774 )),
34775 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
34776 AIRSPEED_DATA::ID => Some(Self::AIRSPEED(AIRSPEED_DATA::random(rng))),
34777 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
34778 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
34779 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
34780 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34781 ATTITUDE_QUATERNION_DATA::random(rng),
34782 )),
34783 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34784 ATTITUDE_QUATERNION_COV_DATA::random(rng),
34785 )),
34786 ATTITUDE_TARGET_DATA::ID => {
34787 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
34788 }
34789 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
34790 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
34791 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34792 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34793 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
34794 ))
34795 }
34796 AUTOPILOT_VERSION_DATA::ID => {
34797 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
34798 }
34799 AVAILABLE_MODES_DATA::ID => {
34800 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
34801 }
34802 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34803 AVAILABLE_MODES_MONITOR_DATA::random(rng),
34804 )),
34805 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
34806 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
34807 BATTERY_STATUS_V2_DATA::ID => {
34808 Some(Self::BATTERY_STATUS_V2(BATTERY_STATUS_V2_DATA::random(rng)))
34809 }
34810 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
34811 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34812 CAMERA_CAPTURE_STATUS_DATA::random(rng),
34813 )),
34814 CAMERA_FOV_STATUS_DATA::ID => {
34815 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
34816 }
34817 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34818 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
34819 )),
34820 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
34821 CAMERA_INFORMATION_DATA::random(rng),
34822 )),
34823 CAMERA_SETTINGS_DATA::ID => {
34824 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
34825 }
34826 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34827 CAMERA_THERMAL_RANGE_DATA::random(rng),
34828 )),
34829 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34830 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
34831 )),
34832 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34833 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
34834 )),
34835 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
34836 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
34837 CAN_FILTER_MODIFY_DATA::ID => {
34838 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
34839 }
34840 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
34841 CELLULAR_CONFIG_DATA::ID => {
34842 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
34843 }
34844 CELLULAR_STATUS_DATA::ID => {
34845 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
34846 }
34847 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34848 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
34849 )),
34850 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34851 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
34852 )),
34853 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
34854 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
34855 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
34856 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
34857 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
34858 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34859 COMPONENT_INFORMATION_DATA::random(rng),
34860 )),
34861 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34862 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
34863 )),
34864 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
34865 COMPONENT_METADATA_DATA::random(rng),
34866 )),
34867 CONTROL_STATUS_DATA::ID => Some(Self::CONTROL_STATUS(CONTROL_STATUS_DATA::random(rng))),
34868 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34869 CONTROL_SYSTEM_STATE_DATA::random(rng),
34870 )),
34871 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34872 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
34873 )),
34874 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
34875 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
34876 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34877 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
34878 )),
34879 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
34880 DEBUG_FLOAT_ARRAY_DATA::ID => {
34881 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
34882 }
34883 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
34884 DISTANCE_SENSOR_DATA::ID => {
34885 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
34886 }
34887 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
34888 ENCAPSULATED_DATA_DATA::ID => {
34889 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
34890 }
34891 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
34892 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
34893 ESTIMATOR_STATUS_DATA::ID => {
34894 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
34895 }
34896 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
34897 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
34898 EXTENDED_SYS_STATE_DATA::random(rng),
34899 )),
34900 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
34901 FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID => Some(Self::FIGURE_EIGHT_EXECUTION_STATUS(
34902 FIGURE_EIGHT_EXECUTION_STATUS_DATA::random(rng),
34903 )),
34904 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34905 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
34906 )),
34907 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
34908 FLIGHT_INFORMATION_DATA::random(rng),
34909 )),
34910 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
34911 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
34912 GENERATOR_STATUS_DATA::ID => {
34913 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
34914 }
34915 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34916 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
34917 )),
34918 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34919 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
34920 )),
34921 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34922 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
34923 )),
34924 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34925 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
34926 )),
34927 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
34928 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
34929 )),
34930 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34931 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
34932 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
34933 ))
34934 }
34935 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34936 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
34937 )),
34938 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34939 GIMBAL_MANAGER_STATUS_DATA::random(rng),
34940 )),
34941 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34942 GLOBAL_POSITION_INT_DATA::random(rng),
34943 )),
34944 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
34945 GLOBAL_POSITION_INT_COV_DATA::random(rng),
34946 )),
34947 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34948 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34949 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
34950 ))
34951 }
34952 GNSS_INTEGRITY_DATA::ID => Some(Self::GNSS_INTEGRITY(GNSS_INTEGRITY_DATA::random(rng))),
34953 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
34954 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
34955 GPS_GLOBAL_ORIGIN_DATA::ID => {
34956 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
34957 }
34958 GPS_INJECT_DATA_DATA::ID => {
34959 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
34960 }
34961 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
34962 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
34963 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
34964 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
34965 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
34966 GROUP_END_DATA::ID => Some(Self::GROUP_END(GROUP_END_DATA::random(rng))),
34967 GROUP_START_DATA::ID => Some(Self::GROUP_START(GROUP_START_DATA::random(rng))),
34968 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
34969 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
34970 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
34971 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
34972 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
34973 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
34974 )),
34975 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
34976 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
34977 HIL_OPTICAL_FLOW_DATA::ID => {
34978 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
34979 }
34980 HIL_RC_INPUTS_RAW_DATA::ID => {
34981 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
34982 }
34983 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
34984 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
34985 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
34986 HIL_STATE_QUATERNION_DATA::random(rng),
34987 )),
34988 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
34989 HYGROMETER_SENSOR_DATA::ID => {
34990 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
34991 }
34992 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
34993 ILLUMINATOR_STATUS_DATA::random(rng),
34994 )),
34995 ISBD_LINK_STATUS_DATA::ID => {
34996 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
34997 }
34998 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
34999 LINK_NODE_STATUS_DATA::ID => {
35000 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
35001 }
35002 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
35003 LOCAL_POSITION_NED_DATA::random(rng),
35004 )),
35005 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35006 LOCAL_POSITION_NED_COV_DATA::random(rng),
35007 )),
35008 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35009 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35010 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
35011 ))
35012 }
35013 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
35014 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
35015 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
35016 LOGGING_DATA_ACKED_DATA::random(rng),
35017 )),
35018 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
35019 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
35020 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
35021 LOG_REQUEST_DATA_DATA::ID => {
35022 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
35023 }
35024 LOG_REQUEST_END_DATA::ID => {
35025 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
35026 }
35027 LOG_REQUEST_LIST_DATA::ID => {
35028 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
35029 }
35030 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
35031 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
35032 MANUAL_SETPOINT_DATA::ID => {
35033 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
35034 }
35035 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
35036 MESSAGE_INTERVAL_DATA::ID => {
35037 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
35038 }
35039 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
35040 MISSION_CLEAR_ALL_DATA::ID => {
35041 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
35042 }
35043 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
35044 MISSION_CURRENT_DATA::ID => {
35045 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
35046 }
35047 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
35048 MISSION_ITEM_INT_DATA::ID => {
35049 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
35050 }
35051 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35052 MISSION_ITEM_REACHED_DATA::random(rng),
35053 )),
35054 MISSION_REQUEST_DATA::ID => {
35055 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
35056 }
35057 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35058 MISSION_REQUEST_INT_DATA::random(rng),
35059 )),
35060 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35061 MISSION_REQUEST_LIST_DATA::random(rng),
35062 )),
35063 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35064 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
35065 )),
35066 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35067 MISSION_SET_CURRENT_DATA::random(rng),
35068 )),
35069 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35070 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
35071 )),
35072 MOUNT_ORIENTATION_DATA::ID => {
35073 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
35074 }
35075 NAMED_VALUE_FLOAT_DATA::ID => {
35076 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
35077 }
35078 NAMED_VALUE_INT_DATA::ID => {
35079 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
35080 }
35081 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35082 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
35083 )),
35084 OBSTACLE_DISTANCE_DATA::ID => {
35085 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
35086 }
35087 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
35088 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35089 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
35090 )),
35091 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35092 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
35093 )),
35094 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35095 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
35096 )),
35097 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35098 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
35099 )),
35100 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35101 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
35102 )),
35103 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35104 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
35105 )),
35106 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35107 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
35108 )),
35109 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35110 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
35111 )),
35112 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35113 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
35114 )),
35115 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35116 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
35117 )),
35118 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
35119 OPTICAL_FLOW_RAD_DATA::ID => {
35120 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
35121 }
35122 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35123 ORBIT_EXECUTION_STATUS_DATA::random(rng),
35124 )),
35125 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
35126 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35127 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
35128 )),
35129 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35130 PARAM_EXT_REQUEST_READ_DATA::random(rng),
35131 )),
35132 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
35133 PARAM_EXT_VALUE_DATA::ID => {
35134 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
35135 }
35136 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
35137 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
35138 PARAM_REQUEST_LIST_DATA::random(rng),
35139 )),
35140 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
35141 PARAM_REQUEST_READ_DATA::random(rng),
35142 )),
35143 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
35144 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
35145 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
35146 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
35147 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
35148 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35149 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35150 )),
35151 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35152 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35153 )),
35154 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
35155 PROTOCOL_VERSION_DATA::ID => {
35156 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
35157 }
35158 RADIO_RC_CHANNELS_DATA::ID => {
35159 Some(Self::RADIO_RC_CHANNELS(RADIO_RC_CHANNELS_DATA::random(rng)))
35160 }
35161 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
35162 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
35163 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
35164 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
35165 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
35166 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35167 RC_CHANNELS_OVERRIDE_DATA::random(rng),
35168 )),
35169 RC_CHANNELS_RAW_DATA::ID => {
35170 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
35171 }
35172 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
35173 RC_CHANNELS_SCALED_DATA::random(rng),
35174 )),
35175 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35176 REQUEST_DATA_STREAM_DATA::random(rng),
35177 )),
35178 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
35179 RESOURCE_REQUEST_DATA::ID => {
35180 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
35181 }
35182 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35183 RESPONSE_EVENT_ERROR_DATA::random(rng),
35184 )),
35185 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35186 SAFETY_ALLOWED_AREA_DATA::random(rng),
35187 )),
35188 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35189 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
35190 )),
35191 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
35192 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
35193 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
35194 SCALED_PRESSURE_DATA::ID => {
35195 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
35196 }
35197 SCALED_PRESSURE2_DATA::ID => {
35198 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
35199 }
35200 SCALED_PRESSURE3_DATA::ID => {
35201 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
35202 }
35203 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
35204 SERVO_OUTPUT_RAW_DATA::ID => {
35205 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
35206 }
35207 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
35208 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35209 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35210 )),
35211 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35212 SET_ATTITUDE_TARGET_DATA::random(rng),
35213 )),
35214 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35215 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
35216 )),
35217 SET_HOME_POSITION_DATA::ID => {
35218 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
35219 }
35220 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
35221 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35222 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35223 )),
35224 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35225 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35226 )),
35227 SET_VELOCITY_LIMITS_DATA::ID => Some(Self::SET_VELOCITY_LIMITS(
35228 SET_VELOCITY_LIMITS_DATA::random(rng),
35229 )),
35230 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
35231 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
35232 SMART_BATTERY_INFO_DATA::random(rng),
35233 )),
35234 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
35235 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35236 STORAGE_INFORMATION_DATA::random(rng),
35237 )),
35238 SUPPORTED_TUNES_DATA::ID => {
35239 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
35240 }
35241 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
35242 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
35243 TARGET_ABSOLUTE_DATA::ID => {
35244 Some(Self::TARGET_ABSOLUTE(TARGET_ABSOLUTE_DATA::random(rng)))
35245 }
35246 TARGET_RELATIVE_DATA::ID => {
35247 Some(Self::TARGET_RELATIVE(TARGET_RELATIVE_DATA::random(rng)))
35248 }
35249 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
35250 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
35251 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
35252 TERRAIN_REQUEST_DATA::ID => {
35253 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
35254 }
35255 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
35256 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35257 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
35258 )),
35259 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35260 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35261 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35262 ))
35263 }
35264 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35265 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35266 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35267 ))
35268 }
35269 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35270 UAVCAN_NODE_INFO_DATA::ID => {
35271 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35272 }
35273 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35274 UAVCAN_NODE_STATUS_DATA::random(rng),
35275 )),
35276 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35277 UTM_GLOBAL_POSITION_DATA::random(rng),
35278 )),
35279 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35280 VELOCITY_LIMITS_DATA::ID => {
35281 Some(Self::VELOCITY_LIMITS(VELOCITY_LIMITS_DATA::random(rng)))
35282 }
35283 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35284 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35285 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35286 VICON_POSITION_ESTIMATE_DATA::random(rng),
35287 )),
35288 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35289 VIDEO_STREAM_INFORMATION_DATA::random(rng),
35290 )),
35291 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35292 VIDEO_STREAM_STATUS_DATA::random(rng),
35293 )),
35294 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35295 VISION_POSITION_ESTIMATE_DATA::random(rng),
35296 )),
35297 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35298 VISION_SPEED_ESTIMATE_DATA::random(rng),
35299 )),
35300 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
35301 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
35302 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
35303 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
35304 _ => None,
35305 }
35306 }
35307 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35308 match self {
35309 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35310 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
35311 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
35312 Self::AIRSPEED(body) => body.ser(version, bytes),
35313 Self::AIS_VESSEL(body) => body.ser(version, bytes),
35314 Self::ALTITUDE(body) => body.ser(version, bytes),
35315 Self::ATTITUDE(body) => body.ser(version, bytes),
35316 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
35317 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
35318 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
35319 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
35320 Self::AUTH_KEY(body) => body.ser(version, bytes),
35321 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
35322 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
35323 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
35324 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
35325 Self::BATTERY_INFO(body) => body.ser(version, bytes),
35326 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
35327 Self::BATTERY_STATUS_V2(body) => body.ser(version, bytes),
35328 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
35329 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
35330 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
35331 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
35332 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
35333 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
35334 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
35335 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
35336 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
35337 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
35338 Self::CANFD_FRAME(body) => body.ser(version, bytes),
35339 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
35340 Self::CAN_FRAME(body) => body.ser(version, bytes),
35341 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
35342 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
35343 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
35344 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
35345 Self::COLLISION(body) => body.ser(version, bytes),
35346 Self::COMMAND_ACK(body) => body.ser(version, bytes),
35347 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
35348 Self::COMMAND_INT(body) => body.ser(version, bytes),
35349 Self::COMMAND_LONG(body) => body.ser(version, bytes),
35350 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
35351 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
35352 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
35353 Self::CONTROL_STATUS(body) => body.ser(version, bytes),
35354 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
35355 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
35356 Self::CURRENT_MODE(body) => body.ser(version, bytes),
35357 Self::DATA_STREAM(body) => body.ser(version, bytes),
35358 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
35359 Self::DEBUG(body) => body.ser(version, bytes),
35360 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
35361 Self::DEBUG_VECT(body) => body.ser(version, bytes),
35362 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
35363 Self::EFI_STATUS(body) => body.ser(version, bytes),
35364 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
35365 Self::ESC_INFO(body) => body.ser(version, bytes),
35366 Self::ESC_STATUS(body) => body.ser(version, bytes),
35367 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
35368 Self::EVENT(body) => body.ser(version, bytes),
35369 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
35370 Self::FENCE_STATUS(body) => body.ser(version, bytes),
35371 Self::FIGURE_EIGHT_EXECUTION_STATUS(body) => body.ser(version, bytes),
35372 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
35373 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
35374 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
35375 Self::FUEL_STATUS(body) => body.ser(version, bytes),
35376 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
35377 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
35378 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
35379 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
35380 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
35381 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
35382 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
35383 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
35384 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
35385 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
35386 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
35387 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35388 Self::GNSS_INTEGRITY(body) => body.ser(version, bytes),
35389 Self::GPS2_RAW(body) => body.ser(version, bytes),
35390 Self::GPS2_RTK(body) => body.ser(version, bytes),
35391 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35392 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
35393 Self::GPS_INPUT(body) => body.ser(version, bytes),
35394 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
35395 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
35396 Self::GPS_RTK(body) => body.ser(version, bytes),
35397 Self::GPS_STATUS(body) => body.ser(version, bytes),
35398 Self::GROUP_END(body) => body.ser(version, bytes),
35399 Self::GROUP_START(body) => body.ser(version, bytes),
35400 Self::HEARTBEAT(body) => body.ser(version, bytes),
35401 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
35402 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
35403 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
35404 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
35405 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
35406 Self::HIL_GPS(body) => body.ser(version, bytes),
35407 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
35408 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
35409 Self::HIL_SENSOR(body) => body.ser(version, bytes),
35410 Self::HIL_STATE(body) => body.ser(version, bytes),
35411 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
35412 Self::HOME_POSITION(body) => body.ser(version, bytes),
35413 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
35414 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
35415 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
35416 Self::LANDING_TARGET(body) => body.ser(version, bytes),
35417 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
35418 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
35419 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
35420 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
35421 Self::LOGGING_ACK(body) => body.ser(version, bytes),
35422 Self::LOGGING_DATA(body) => body.ser(version, bytes),
35423 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
35424 Self::LOG_DATA(body) => body.ser(version, bytes),
35425 Self::LOG_ENTRY(body) => body.ser(version, bytes),
35426 Self::LOG_ERASE(body) => body.ser(version, bytes),
35427 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
35428 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
35429 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
35430 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
35431 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
35432 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
35433 Self::MEMORY_VECT(body) => body.ser(version, bytes),
35434 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
35435 Self::MISSION_ACK(body) => body.ser(version, bytes),
35436 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
35437 Self::MISSION_COUNT(body) => body.ser(version, bytes),
35438 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
35439 Self::MISSION_ITEM(body) => body.ser(version, bytes),
35440 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
35441 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
35442 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
35443 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
35444 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
35445 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
35446 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
35447 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
35448 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
35449 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
35450 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
35451 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
35452 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
35453 Self::ODOMETRY(body) => body.ser(version, bytes),
35454 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
35455 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
35456 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
35457 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
35458 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
35459 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
35460 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
35461 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
35462 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
35463 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
35464 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
35465 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
35466 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
35467 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
35468 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
35469 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
35470 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
35471 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
35472 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
35473 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
35474 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
35475 Self::PARAM_SET(body) => body.ser(version, bytes),
35476 Self::PARAM_VALUE(body) => body.ser(version, bytes),
35477 Self::PING(body) => body.ser(version, bytes),
35478 Self::PLAY_TUNE(body) => body.ser(version, bytes),
35479 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
35480 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35481 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35482 Self::POWER_STATUS(body) => body.ser(version, bytes),
35483 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
35484 Self::RADIO_RC_CHANNELS(body) => body.ser(version, bytes),
35485 Self::RADIO_STATUS(body) => body.ser(version, bytes),
35486 Self::RAW_IMU(body) => body.ser(version, bytes),
35487 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
35488 Self::RAW_RPM(body) => body.ser(version, bytes),
35489 Self::RC_CHANNELS(body) => body.ser(version, bytes),
35490 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
35491 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
35492 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
35493 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
35494 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
35495 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
35496 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
35497 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
35498 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
35499 Self::SCALED_IMU(body) => body.ser(version, bytes),
35500 Self::SCALED_IMU2(body) => body.ser(version, bytes),
35501 Self::SCALED_IMU3(body) => body.ser(version, bytes),
35502 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
35503 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
35504 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
35505 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
35506 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
35507 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
35508 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35509 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
35510 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35511 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
35512 Self::SET_MODE(body) => body.ser(version, bytes),
35513 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35514 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35515 Self::SET_VELOCITY_LIMITS(body) => body.ser(version, bytes),
35516 Self::SIM_STATE(body) => body.ser(version, bytes),
35517 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
35518 Self::STATUSTEXT(body) => body.ser(version, bytes),
35519 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
35520 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
35521 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
35522 Self::SYS_STATUS(body) => body.ser(version, bytes),
35523 Self::TARGET_ABSOLUTE(body) => body.ser(version, bytes),
35524 Self::TARGET_RELATIVE(body) => body.ser(version, bytes),
35525 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
35526 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
35527 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
35528 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
35529 Self::TIMESYNC(body) => body.ser(version, bytes),
35530 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
35531 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
35532 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
35533 Self::TUNNEL(body) => body.ser(version, bytes),
35534 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
35535 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
35536 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
35537 Self::V2_EXTENSION(body) => body.ser(version, bytes),
35538 Self::VELOCITY_LIMITS(body) => body.ser(version, bytes),
35539 Self::VFR_HUD(body) => body.ser(version, bytes),
35540 Self::VIBRATION(body) => body.ser(version, bytes),
35541 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35542 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
35543 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
35544 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35545 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
35546 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
35547 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
35548 Self::WINCH_STATUS(body) => body.ser(version, bytes),
35549 Self::WIND_COV(body) => body.ser(version, bytes),
35550 }
35551 }
35552 fn extra_crc(id: u32) -> u8 {
35553 match id {
35554 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35555 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
35556 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
35557 AIRSPEED_DATA::ID => AIRSPEED_DATA::EXTRA_CRC,
35558 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
35559 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
35560 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
35561 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
35562 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
35563 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
35564 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
35565 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
35566 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35567 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
35568 }
35569 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
35570 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
35571 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
35572 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
35573 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
35574 BATTERY_STATUS_V2_DATA::ID => BATTERY_STATUS_V2_DATA::EXTRA_CRC,
35575 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
35576 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
35577 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
35578 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
35579 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
35580 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
35581 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
35582 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
35583 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
35584 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
35585 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
35586 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
35587 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
35588 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
35589 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
35590 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
35591 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
35592 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
35593 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
35594 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
35595 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
35596 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
35597 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
35598 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
35599 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
35600 CONTROL_STATUS_DATA::ID => CONTROL_STATUS_DATA::EXTRA_CRC,
35601 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
35602 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
35603 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
35604 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
35605 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
35606 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
35607 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
35608 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
35609 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
35610 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
35611 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
35612 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
35613 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
35614 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
35615 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
35616 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
35617 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
35618 FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID => FIGURE_EIGHT_EXECUTION_STATUS_DATA::EXTRA_CRC,
35619 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
35620 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
35621 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
35622 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
35623 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
35624 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
35625 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
35626 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
35627 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
35628 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
35629 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35630 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
35631 }
35632 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
35633 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
35634 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
35635 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
35636 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35637 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
35638 }
35639 GNSS_INTEGRITY_DATA::ID => GNSS_INTEGRITY_DATA::EXTRA_CRC,
35640 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
35641 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
35642 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35643 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
35644 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
35645 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
35646 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
35647 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
35648 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
35649 GROUP_END_DATA::ID => GROUP_END_DATA::EXTRA_CRC,
35650 GROUP_START_DATA::ID => GROUP_START_DATA::EXTRA_CRC,
35651 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
35652 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
35653 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
35654 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
35655 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
35656 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
35657 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
35658 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
35659 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
35660 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
35661 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
35662 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
35663 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
35664 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
35665 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
35666 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
35667 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
35668 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
35669 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
35670 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
35671 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35672 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
35673 }
35674 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
35675 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
35676 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
35677 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
35678 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
35679 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
35680 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
35681 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
35682 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
35683 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
35684 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
35685 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
35686 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
35687 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
35688 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
35689 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
35690 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
35691 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
35692 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
35693 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
35694 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
35695 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
35696 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
35697 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
35698 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
35699 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
35700 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
35701 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
35702 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
35703 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
35704 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
35705 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
35706 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
35707 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
35708 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
35709 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
35710 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
35711 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
35712 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
35713 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
35714 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
35715 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
35716 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
35717 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
35718 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
35719 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
35720 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
35721 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
35722 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
35723 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
35724 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
35725 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
35726 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
35727 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
35728 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
35729 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
35730 PING_DATA::ID => PING_DATA::EXTRA_CRC,
35731 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
35732 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
35733 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
35734 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35735 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
35736 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
35737 RADIO_RC_CHANNELS_DATA::ID => RADIO_RC_CHANNELS_DATA::EXTRA_CRC,
35738 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
35739 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
35740 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
35741 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
35742 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
35743 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
35744 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
35745 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
35746 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
35747 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
35748 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
35749 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
35750 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
35751 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
35752 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
35753 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
35754 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
35755 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
35756 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
35757 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
35758 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
35759 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
35760 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
35761 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35762 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
35763 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35764 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
35765 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
35766 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35767 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
35768 }
35769 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35770 SET_VELOCITY_LIMITS_DATA::ID => SET_VELOCITY_LIMITS_DATA::EXTRA_CRC,
35771 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
35772 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
35773 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
35774 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
35775 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
35776 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
35777 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
35778 TARGET_ABSOLUTE_DATA::ID => TARGET_ABSOLUTE_DATA::EXTRA_CRC,
35779 TARGET_RELATIVE_DATA::ID => TARGET_RELATIVE_DATA::EXTRA_CRC,
35780 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
35781 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
35782 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
35783 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
35784 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
35785 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
35786 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35787 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
35788 }
35789 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35790 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
35791 }
35792 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
35793 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
35794 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
35795 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
35796 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
35797 VELOCITY_LIMITS_DATA::ID => VELOCITY_LIMITS_DATA::EXTRA_CRC,
35798 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
35799 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
35800 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35801 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
35802 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
35803 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35804 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
35805 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
35806 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
35807 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
35808 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
35809 _ => 0,
35810 }
35811 }
35812 fn target_system_id(&self) -> Option<u8> {
35813 match self {
35814 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
35815 Self::CANFD_FRAME(inner) => Some(inner.target_system),
35816 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
35817 Self::CAN_FRAME(inner) => Some(inner.target_system),
35818 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
35819 Self::COMMAND_ACK(inner) => Some(inner.target_system),
35820 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
35821 Self::COMMAND_INT(inner) => Some(inner.target_system),
35822 Self::COMMAND_LONG(inner) => Some(inner.target_system),
35823 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
35824 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
35825 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
35826 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
35827 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
35828 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
35829 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
35830 Self::LOGGING_ACK(inner) => Some(inner.target_system),
35831 Self::LOGGING_DATA(inner) => Some(inner.target_system),
35832 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
35833 Self::LOG_ERASE(inner) => Some(inner.target_system),
35834 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
35835 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
35836 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
35837 Self::MISSION_ACK(inner) => Some(inner.target_system),
35838 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
35839 Self::MISSION_COUNT(inner) => Some(inner.target_system),
35840 Self::MISSION_ITEM(inner) => Some(inner.target_system),
35841 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
35842 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
35843 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
35844 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
35845 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
35846 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
35847 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
35848 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
35849 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
35850 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
35851 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
35852 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
35853 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
35854 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
35855 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
35856 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
35857 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
35858 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
35859 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
35860 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
35861 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
35862 Self::PARAM_SET(inner) => Some(inner.target_system),
35863 Self::PING(inner) => Some(inner.target_system),
35864 Self::PLAY_TUNE(inner) => Some(inner.target_system),
35865 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
35866 Self::RADIO_RC_CHANNELS(inner) => Some(inner.target_system),
35867 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
35868 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
35869 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
35870 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
35871 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
35872 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
35873 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
35874 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
35875 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
35876 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
35877 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
35878 Self::SET_MODE(inner) => Some(inner.target_system),
35879 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
35880 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
35881 Self::SET_VELOCITY_LIMITS(inner) => Some(inner.target_system),
35882 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
35883 Self::TIMESYNC(inner) => Some(inner.target_system),
35884 Self::TUNNEL(inner) => Some(inner.target_system),
35885 Self::V2_EXTENSION(inner) => Some(inner.target_system),
35886 _ => None,
35887 }
35888 }
35889 fn target_component_id(&self) -> Option<u8> {
35890 match self {
35891 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
35892 Self::CANFD_FRAME(inner) => Some(inner.target_component),
35893 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
35894 Self::CAN_FRAME(inner) => Some(inner.target_component),
35895 Self::COMMAND_ACK(inner) => Some(inner.target_component),
35896 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
35897 Self::COMMAND_INT(inner) => Some(inner.target_component),
35898 Self::COMMAND_LONG(inner) => Some(inner.target_component),
35899 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
35900 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
35901 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
35902 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
35903 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
35904 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
35905 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
35906 Self::LOGGING_ACK(inner) => Some(inner.target_component),
35907 Self::LOGGING_DATA(inner) => Some(inner.target_component),
35908 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
35909 Self::LOG_ERASE(inner) => Some(inner.target_component),
35910 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
35911 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
35912 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
35913 Self::MISSION_ACK(inner) => Some(inner.target_component),
35914 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
35915 Self::MISSION_COUNT(inner) => Some(inner.target_component),
35916 Self::MISSION_ITEM(inner) => Some(inner.target_component),
35917 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
35918 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
35919 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
35920 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
35921 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
35922 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
35923 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
35924 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
35925 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
35926 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
35927 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
35928 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
35929 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
35930 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
35931 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
35932 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
35933 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
35934 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
35935 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
35936 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
35937 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
35938 Self::PARAM_SET(inner) => Some(inner.target_component),
35939 Self::PING(inner) => Some(inner.target_component),
35940 Self::PLAY_TUNE(inner) => Some(inner.target_component),
35941 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
35942 Self::RADIO_RC_CHANNELS(inner) => Some(inner.target_component),
35943 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
35944 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
35945 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
35946 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
35947 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
35948 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
35949 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
35950 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
35951 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
35952 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
35953 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
35954 Self::SET_VELOCITY_LIMITS(inner) => Some(inner.target_component),
35955 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
35956 Self::TIMESYNC(inner) => Some(inner.target_component),
35957 Self::TUNNEL(inner) => Some(inner.target_component),
35958 Self::V2_EXTENSION(inner) => Some(inner.target_component),
35959 _ => None,
35960 }
35961 }
35962}